Class: CurationConcerns::Forms::CollectionEditForm
- Inherits:
-
Object
- Object
- CurationConcerns::Forms::CollectionEditForm
- Includes:
- HydraEditor::Form
- Defined in:
- app/forms/curation_concerns/forms/collection_edit_form.rb
Instance Method Summary collapse
-
#required?(key) ⇒ Boolean
Test to see if the given field is required.
-
#select_files ⇒ Hash
All generic files in the collection, file.to_s is the key, file.id is the value.
Instance Method Details
#required?(key) ⇒ Boolean
Test to see if the given field is required
17 18 19 |
# File 'app/forms/curation_concerns/forms/collection_edit_form.rb', line 17 def required?(key) model_class.validators_on(key).any? { |v| v.is_a? ActiveModel::Validations::PresenceValidator } end |
#select_files ⇒ Hash
22 23 24 |
# File 'app/forms/curation_concerns/forms/collection_edit_form.rb', line 22 def select_files Hash[all_files] end |