Class: LinkedRails::Form::FieldFactory
- Inherits:
-
Object
- Object
- LinkedRails::Form::FieldFactory
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/linked_rails/form/field_factory.rb
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- MAX_STR_LEN =
255- VALIDATOR_SELECTORS =
[ [:min_length, ActiveModel::Validations::LengthValidator, :minimum], [:max_length, ActiveModel::Validations::LengthValidator, :maximum], [:pattern, ActiveModel::Validations::FormatValidator, :with], [:presence, ActiveModel::Validations::PresenceValidator, nil], [:sh_in, ActiveModel::Validations::InclusionValidator, :in] ].freeze
Instance Attribute Summary collapse
-
#field_options ⇒ Object
Returns the value of attribute field_options.
-
#form ⇒ Object
Returns the value of attribute form.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
Instance Attribute Details
#field_options ⇒ Object
Returns the value of attribute field_options.
16 17 18 |
# File 'app/models/linked_rails/form/field_factory.rb', line 16 def @field_options end |
#form ⇒ Object
Returns the value of attribute form.
16 17 18 |
# File 'app/models/linked_rails/form/field_factory.rb', line 16 def form @form end |
#key ⇒ Object
Returns the value of attribute key.
16 17 18 |
# File 'app/models/linked_rails/form/field_factory.rb', line 16 def key @key end |
Instance Method Details
#condition_or_field ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/models/linked_rails/form/field_factory.rb', line 26 def condition_or_field @condition_or_field ||= model_policy!.condition_for( key, field, property: [:if] || [], sh_not: [:unless] || [] ) end |