-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add one off rake task for executing Course::PublishService
- Loading branch information
1 parent
181844b
commit fb3bbdf
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
namespace :app do | ||
desc 'We have a course from a previous cycle that we need to publish' | ||
task :publish_course, %i[user_email course_uuid] => :environment do |_task, args| | ||
course_uuid = args[:course_uuid] | ||
user_email = args[:user_email] | ||
|
||
user = User.admins.find_by!(email: user_email) | ||
Course.find_by!(uuid: course_uuid) | ||
Course::PublishService.call(uuid: course_uuid, user:) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters