Class: TypedEAV::Field::Text
- Inherits:
-
Base
- Object
- ActiveRecord::Base
- ApplicationRecord
- Base
- TypedEAV::Field::Text
- Defined in:
- app/models/typed_eav/field/text.rb
Constant Summary
Constants inherited from Base
Constants included from ColumnMapping
ColumnMapping::DEFAULT_OPERATORS_BY_COLUMN, ColumnMapping::FALLBACK_OPERATORS
Instance Method Summary collapse
Methods inherited from Base
#allowed_option_values, #array_field?, #clear_option_cache!, #default_value, #default_value=, #field_type_name, #optionable?
Instance Method Details
#cast(raw) ⇒ Object
15 16 17 |
# File 'app/models/typed_eav/field/text.rb', line 15 def cast(raw) [raw&.to_s, false] end |
#validate_typed_value(record, val) ⇒ Object
19 20 21 22 |
# File 'app/models/typed_eav/field/text.rb', line 19 def validate_typed_value(record, val) validate_length(record, val) validate_pattern(record, val) if pattern.present? end |