Module: Mobility::Plugins::Default::BackendMethods
- Defined in:
- lib/mobility/plugins/default.rb
Backend Accessors collapse
-
#read(locale, accessor_options = {}) ⇒ Object
Gets the translated value for provided locale from configured backend.
Instance Method Details
#read(locale, accessor_options = {}) ⇒ Object
Gets the translated value for provided locale from configured backend.
91 92 93 94 95 96 97 98 |
# File 'lib/mobility/plugins/default.rb', line 91 def read(locale, = {}) default = .has_key?(:default) ? .delete(:default) : [:default] if (value = super(locale, **)).nil? Default[default, locale: locale, accessor_options: , model: model, attribute: attribute] else value end end |