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


19
20
21
# File 'app/api/locomotive/api/forms/site_form.rb', line 19

def domains
  [*@domains]
end

#localesObject

Make sure locales and domains are in arrays.


15
16
17
# File 'app/api/locomotive/api/forms/site_form.rb', line 15

def locales
  [*@locales]
end

#routes=(value) ⇒ Object


33
34
35
# File 'app/api/locomotive/api/forms/site_form.rb', line 33

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

#sections_content=(value) ⇒ Object


29
30
31
# File 'app/api/locomotive/api/forms/site_form.rb', line 29

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

#timezone=(value) ⇒ Object

Custom setters ##


25
26
27
# File 'app/api/locomotive/api/forms/site_form.rb', line 25

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