Sha256: 1fc1637e79f5dd148e20f25ce6c49b4463b57b3249f4b12b5a1878b5d83bc538

Contents?: true

Size: 656 Bytes

Versions: 26

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # Answers queries about the cardinality of each field on the form.
  class FormMetadataService < HydraEditor::FieldMetadataService
    # @param [Class] model_class the class of the object
    # @param [Symbol] field the field we want to know about
    # @return [Boolean] true if the passed in field is a multivalued field
    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
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/services/hyrax/form_metadata_service.rb
hyrax-5.0.1 app/services/hyrax/form_metadata_service.rb
hyrax-5.0.0 app/services/hyrax/form_metadata_service.rb
hyrax-5.0.0.rc3 app/services/hyrax/form_metadata_service.rb
hyrax-5.0.0.rc2 app/services/hyrax/form_metadata_service.rb
hyrax-5.0.0.rc1 app/services/hyrax/form_metadata_service.rb
hyrax-3.6.0 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0.rc3 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0.rc2 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0.rc1 app/services/hyrax/form_metadata_service.rb
hyrax-3.5.0 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0.beta2 app/services/hyrax/form_metadata_service.rb
hyrax-3.4.2 app/services/hyrax/form_metadata_service.rb
hyrax-4.0.0.beta1 app/services/hyrax/form_metadata_service.rb
hyrax-3.4.1 app/services/hyrax/form_metadata_service.rb
hyrax-3.4.0 app/services/hyrax/form_metadata_service.rb
hyrax-3.3.0 app/services/hyrax/form_metadata_service.rb
hyrax-3.2.0 app/services/hyrax/form_metadata_service.rb
hyrax-3.1.0 app/services/hyrax/form_metadata_service.rb