Class: ContentItemFieldType
- Inherits:
-
FieldType
- Object
- FieldType
- ContentItemFieldType
- Defined in:
- app/models/content_item_field_type.rb
Instance Attribute Summary collapse
-
#content_item_id ⇒ Object
Returns the value of attribute content_item_id.
Instance Method Summary collapse
- #data=(data_hash) ⇒ Object
- #field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
- #mapping ⇒ Object
Instance Attribute Details
#content_item_id ⇒ Object
Returns the value of attribute content_item_id.
2 3 4 |
# File 'app/models/content_item_field_type.rb', line 2 def content_item_id @content_item_id end |
Instance Method Details
#data=(data_hash) ⇒ Object
4 5 6 |
# File 'app/models/content_item_field_type.rb', line 4 def data=(data_hash) @content_item_id = data_hash.deep_symbolize_keys[:content_item_id] end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'app/models/content_item_field_type.rb', line 8 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['content_item_id'] json end |
#mapping ⇒ Object
14 15 16 |
# File 'app/models/content_item_field_type.rb', line 14 def mapping { name: mapping_field_name, type: :string, analyzer: :snowball } end |