Class: Sufia::CreateWithFilesActor
- Inherits:
-
CurationConcerns::Actors::AbstractActor
- Object
- CurationConcerns::Actors::AbstractActor
- Sufia::CreateWithFilesActor
- Defined in:
- app/actors/sufia/create_with_files_actor.rb
Overview
Creates a work and attaches files to the work
Instance Method Summary collapse
Instance Method Details
#create(attributes) ⇒ Object
4 5 6 7 |
# File 'app/actors/sufia/create_with_files_actor.rb', line 4 def create(attributes) self.uploaded_file_ids = attributes.delete(:uploaded_files) validate_files && next_actor.create(attributes) && attach_files end |
#update(attributes) ⇒ Object
9 10 11 12 |
# File 'app/actors/sufia/create_with_files_actor.rb', line 9 def update(attributes) self.uploaded_file_ids = attributes.delete(:uploaded_files) validate_files && next_actor.update(attributes) && attach_files end |