Class: Locomotive::CustomFieldService
- Inherits:
-
Struct
- Object
- Struct
- Locomotive::CustomFieldService
- Defined in:
- app/services/locomotive/custom_field_service.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
Instance Method Summary collapse
-
#update_select_options(options) ⇒ Array
Update the options of a “select” field.
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field
2 3 4 |
# File 'app/services/locomotive/custom_field_service.rb', line 2 def field @field end |
Instance Method Details
#update_select_options(options) ⇒ Array
Update the options of a “select” field.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/services/locomotive/custom_field_service.rb', line 10 def () return nil if .blank? # set the right position .each_with_index do |option, position| option['position'] = position end self.field. = # save the content type so that all the content entries get a fresh version # of the custom fields rules self.field._parent.save self.field. end |