Class: Locomotive::Mounter::Models::ContentSelectOption
- Defined in:
- lib/locomotive/mounter/models/content_select_option.rb
Instance Attribute Summary
Attributes inherited from Base
#_id, #created_at, #mounting_point, #updated_at
Instance Method Summary collapse
-
#name ⇒ Object
fields ##.
-
#to_params(options = nil) ⇒ Hash
Return the params used for the API.
Methods inherited from Base
Methods included from Fields
#[], #attributes, #attributes_with_translations, #initialize, #localized_field?, #to_hash, #to_yaml, #translated_in, #translated_in?, #write_attributes
Constructor Details
This class inherits a constructor from Locomotive::Mounter::Models::Base
Instance Method Details
#name ⇒ Object
fields ##
8 |
# File 'lib/locomotive/mounter/models/content_select_option.rb', line 8 field :name, localized: true |
#to_params(options = nil) ⇒ Hash
Return the params used for the API.
19 20 21 22 23 |
# File 'lib/locomotive/mounter/models/content_select_option.rb', line 19 def to_params( = nil) { name: self.name_translations, position: self.position }.tap do |params| params[:id] = self._id if self.persisted? end end |