Class: Locomotive::API::Forms::SiteForm

Inherits:
BaseForm
  • Object
show all
Defined in:
app/api/locomotive/api/forms/site_form.rb

Instance Attribute Summary

Attributes inherited from BaseForm

#_persisted, #_policy

Instance Method Summary collapse

Methods inherited from BaseForm

attributes, attrs, define_attribute, #persisted?, #serializable_hash, #set_attribute

Instance Method Details

#domainsObject



21
22
23
# File 'app/api/locomotive/api/forms/site_form.rb', line 21

def domains
  [*@domains]
end

#localesObject

Make sure locales and domains are in arrays.



17
18
19
# File 'app/api/locomotive/api/forms/site_form.rb', line 17

def locales
  [*@locales]
end

#routes=(value) ⇒ Object



35
36
37
# File 'app/api/locomotive/api/forms/site_form.rb', line 35

def routes=(value)
  set_attribute(:routes, value.is_a?(String) ? parse_json(value, []) : value)
end

#sections_content=(value) ⇒ Object



31
32
33
# File 'app/api/locomotive/api/forms/site_form.rb', line 31

def sections_content=(value)
  set_attribute(:sections_content, value.is_a?(String) ? parse_json(value, {}) : value)
end

#timezone=(value) ⇒ Object

Custom setters ##



27
28
29
# File 'app/api/locomotive/api/forms/site_form.rb', line 27

def timezone=(value)
  self.timezone_name = value
end