Module: CurationConcerns::WorkActorBehavior

Includes:
ManagesEmbargoesActor
Defined in:
app/actors/curation_concerns/work_actor_behavior.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ManagesEmbargoesActor

#interpret_embargo_visibility, #interpret_lease_visibility, #interpret_visibility

Instance Attribute Details

#raw_attributesObject

Returns the value of attribute raw_attributes.



3
4
5
# File 'app/actors/curation_concerns/work_actor_behavior.rb', line 3

def raw_attributes
  @raw_attributes
end

Instance Method Details

#createObject



5
6
7
8
9
10
11
# File 'app/actors/curation_concerns/work_actor_behavior.rb', line 5

def create
  # set the @files ivar then remove the files attribute so it isn't set by default.
  files && attributes.delete(:files)
  self.raw_attributes = attributes.dup
  # Files must be attached before saving in order to persist their relationship to the work
  assign_pid && interpret_visibility && attach_files && super && assign_representative
end

#updateObject



13
14
15
16
# File 'app/actors/curation_concerns/work_actor_behavior.rb', line 13

def update
  add_to_collections(attributes.delete(:collection_ids)) &&
    interpret_visibility && apply_order(attributes.delete(:ordered_member_ids)) && super && attach_files
end