Class: Course::DuplicationJob

Inherits:
ApplicationJob show all
Includes:
TrackableJob
Defined in:
app/jobs/course/duplication_job.rb

Instance Attribute Summary

Attributes included from TrackableJob

#job

Instance Method Summary collapse

Methods included from TrackableJob

#initialize, #job_id=, #perform, #rescue_tracked, #wait

Instance Method Details

#perform_tracked(source_course, options = {}) ⇒ Object (protected)

Performs the duplication job.


13
14
15
16
17
18
19
# File 'app/jobs/course/duplication_job.rb', line 13

def perform_tracked(source_course, options = {})
  ActsAsTenant.without_tenant do
    new_course =
      Course::Duplication::CourseDuplicationService.duplicate_course(source_course, options)
    redirect_to course_path(new_course) if new_course.valid?
  end
end