Class: TagsField

Inherits:
ArrayField show all
Defined in:
lib/yodel/models/core/fields/tags_field.rb

Constant Summary

Constants inherited from Field

Field::TYPES

Instance Attribute Summary

Attributes inherited from Field

#name, #options

Instance Method Summary collapse

Methods inherited from ArrayField

#initialize, #json_action, #typecast, #untypecast

Methods inherited from Field

#default_input_type, #display?, field_from_type, from_options, #include_in_search_keywords?, #index?, #inherited?, #initialize, #method_missing, #numeric?, #required?, #searchable?, #strip_nil?, #to_json, #to_str, #typecast, #unique?, #untypecast, #validate

Constructor Details

This class inherits a constructor from ArrayField

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Field

Instance Method Details

#from_json(value, record) ⇒ Object



2
3
4
# File 'lib/yodel/models/core/fields/tags_field.rb', line 2

def from_json(value, record)
  value.to_s.split(',').map(&:strip).reject(&:blank?).uniq
end