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
# File 'app/services/hyrax/form_metadata_service.rb', line 7

def self.multiple?(model_class, field)
  return true if ['ordered_member_ids', 'in_works_ids', 'member_of_collection_ids'].include? field.to_s
  # Inquire at the model level
  super
end