Class: Hyrax::Forms::WorkEmbargoForm

Inherits:
ChangeSet
  • Object
show all
Defined in:
app/forms/hyrax/forms/work_embargo_form.rb

Overview

Note:

this supports the edit functionality of EmbargoesControllerBehavior.

Represents an embargo for edit through a work. That is, this form can be used to wrap a Work in order to capture state changes related only to its embargo, ignoring the work’s other fields.

Instance Method Summary collapse

Methods inherited from ChangeSet

for

Instance Method Details

#embargo_populatorObject



18
19
20
# File 'app/forms/hyrax/forms/work_embargo_form.rb', line 18

def embargo_populator(**)
  self.embargo = Hyrax::EmbargoManager.embargo_for(resource: model)
end

#human_readable_typeString

Returns:

  • (String)


24
25
26
# File 'app/forms/hyrax/forms/work_embargo_form.rb', line 24

def human_readable_type
  model.to_model.human_readable_type
end

#model_nameActiveModel::Name

Returns:

  • (ActiveModel::Name)


30
31
32
# File 'app/forms/hyrax/forms/work_embargo_form.rb', line 30

def model_name
  model.to_model.model_name
end