Class: Hyrax::M3SchemaLoader::M3AttributeDefinition Private

Inherits:
SchemaLoader::AttributeDefinition show all
Defined in:
app/services/hyrax/m3_schema_loader.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

M3-specific AttributeDefinition that properly handles cardinality-based requirements

Constant Summary

Constants inherited from SchemaLoader::AttributeDefinition

SchemaLoader::AttributeDefinition::Coerce

Instance Attribute Summary

Attributes inherited from SchemaLoader::AttributeDefinition

#config, #name

Instance Method Summary collapse

Methods inherited from SchemaLoader::AttributeDefinition

#admin_only?, #display_label, #editor_only?, #index_keys, #initialize, #multiple?, #type, #view_options

Constructor Details

This class inherits a constructor from Hyrax::SchemaLoader::AttributeDefinition

Instance Method Details

#form_optionsHash{Symbol => Object}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash{Symbol => Object})


99
100
101
102
103
104
105
106
# File 'app/services/hyrax/m3_schema_loader.rb', line 99

def form_options
  options = super

  # Check if minimum cardinality makes this field required
  options = options.merge(required: true) if cardinality_required?

  options
end