Class: Locomotive::SiteMetafieldsService
- Inherits:
-
Struct
- Object
- Struct
- Locomotive::SiteMetafieldsService
- Includes:
- Concerns::ActivityService
- Defined in:
- app/services/locomotive/site_metafields_service.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
Methods included from Concerns::ActivityService
#track_activity, #without_tracking_activity
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account
3 4 5 |
# File 'app/services/locomotive/site_metafields_service.rb', line 3 def account @account end |
#site ⇒ Object
Returns the value of attribute site
3 4 5 |
# File 'app/services/locomotive/site_metafields_service.rb', line 3 def site @site end |
Instance Method Details
#update_all(attributes) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/services/locomotive/site_metafields_service.rb', line 7 def update_all(attributes) (attributes) do |namespace, name, value| next unless field = site.(name) if field['localized'] (namespace[name] ||= {})[locale] = value else namespace[name] = value end end if site.save track_activity 'site_metafields.updated' end end |