Class: Hyrax::FormMetadataService

Inherits:
HydraEditor::FieldMetadataService
  • Object
show all
Defined in:
app/services/hyrax/form_metadata_service.rb

Overview

Answers queries about the cardinality of each field on the form.

Class Method Summary collapse

Class Method Details

.multiple?(model_class, field) ⇒ Boolean

Returns true if the passed in field is a multivalued field.

Parameters:

  • model_class (Class)

    the class of the object

  • field (Symbol)

    the field we want to know about

Returns:

  • (Boolean)

    true if the passed in field is a multivalued field


7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/hyrax/form_metadata_service.rb', line 7

def self.multiple?(model_class, field)
  case field.to_s
  when 'rights_statement'
    false
  when 'ordered_member_ids', 'in_works_ids', 'member_of_collection_ids'
    true
  else
    # Inquire at the model level
    super
  end
end