Class: UserFieldType
- Inherits:
-
FieldType
- Object
- FieldType
- UserFieldType
- Defined in:
- app/models/user_field_type.rb
Instance Attribute Summary collapse
-
#user_id ⇒ Object
Returns the value of attribute user_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
#user_id ⇒ Object
Returns the value of attribute user_id.
2 3 4 |
# File 'app/models/user_field_type.rb', line 2 def user_id @user_id end |
Instance Method Details
#data=(data_hash) ⇒ Object
7 8 9 |
# File 'app/models/user_field_type.rb', line 7 def data=(data_hash) @user_id = data_hash.deep_symbolize_keys[:user_id] end |
#field_item_as_indexed_json_for_field_type(field_item, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'app/models/user_field_type.rb', line 11 def field_item_as_indexed_json_for_field_type(field_item, = {}) json = {} json[mapping_field_name] = field_item.data['user_id'] json end |
#mapping ⇒ Object
17 18 19 |
# File 'app/models/user_field_type.rb', line 17 def mapping {name: mapping_field_name, type: :string, analyzer: :snowball} end |