Class: CreateWorkJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- CreateWorkJob
- Defined in:
- app/jobs/create_work_job.rb
Instance Method Summary collapse
-
#perform(user, model, attributes, operation) ⇒ Object
This copies metadata from the passed in attribute to all of the works that are members of the given upload set.
Instance Method Details
#perform(user, model, attributes, operation) ⇒ Object
This copies metadata from the passed in attribute to all of the works that are members of the given upload set
15 16 17 18 19 20 21 22 |
# File 'app/jobs/create_work_job.rb', line 15 def perform(user, model, attributes, operation) operation.performing! work = model.constantize.new actor = work_actor(work, user) status = actor.create(attributes) return operation.success! if status operation.fail!(work.errors..join(' ')) end |