Class: Hyrax::CreateWithFilesActor

Inherits:
Actors::AbstractActor show all
Defined in:
app/actors/hyrax/create_with_files_actor.rb

Overview

Creates a work and attaches files to the work

Instance Attribute Summary

Attributes inherited from Actors::AbstractActor

#next_actor

Instance Method Summary collapse

Methods inherited from Actors::AbstractActor

#initialize

Constructor Details

This class inherits a constructor from Hyrax::Actors::AbstractActor

Instance Method Details

#create(attributes) ⇒ Object



4
5
6
7
# File 'app/actors/hyrax/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/hyrax/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