Module: Mobility::ActiveModel::AttributeMethods
- Defined in:
- lib/mobility/active_model/attribute_methods.rb
Overview
Included into model if model has ActiveModel::AttributeMethods
among its ancestors.
Instance Method Summary collapse
-
#attributes ⇒ Array<String>
Adds translated attributes to
attributes
. -
#translated_attributes ⇒ Array<String>
Translated attributes defined on model.
Instance Method Details
#attributes ⇒ Array<String>
Adds translated attributes to attributes
.
14 15 16 |
# File 'lib/mobility/active_model/attribute_methods.rb', line 14 def attributes super.merge(translated_attributes) end |
#translated_attributes ⇒ Array<String>
Translated attributes defined on model.
20 21 22 23 24 |
# File 'lib/mobility/active_model/attribute_methods.rb', line 20 def translated_attributes translated_attribute_names.inject({}) do |attributes, name| attributes.merge(name.to_s => send(name)) end end |