Class: Mobility::Backends::ActiveRecord::Json
- Inherits:
-
PgHash
- Object
- PgHash
- Mobility::Backends::ActiveRecord::Json
- Defined in:
- lib/mobility/backends/active_record/json.rb
Backend Accessors collapse
-
#read(locale, **options) ⇒ String, ...
Value of translation.
Class Method Summary collapse
-
.build_node(attr, locale) ⇒ Mobility::Plugins::Arel::Nodes::Json
Arel node for value of attribute key on jsonb column.
Instance Method Summary collapse
-
#write(locale, value, **options) ⇒ String, ...
Updated value.
Methods included from Mobility::Backends::ActiveRecord
Class Method Details
.build_node(attr, locale) ⇒ Mobility::Plugins::Arel::Nodes::Json
Returns Arel node for value of attribute key on jsonb column.
37 38 39 40 |
# File 'lib/mobility/backends/active_record/json.rb', line 37 def self.build_node(attr, locale) column_name = column_affix % attr Plugins::Arel::Nodes::Json.new(model_class.arel_table[column_name], build_quoted(locale)) end |
Instance Method Details
#read(locale, **options) ⇒ String, ...
Note:
Translation may be string, integer or boolean-valued since value is stored on a JSON hash.
Returns Value of translation.
|
# File 'lib/mobility/backends/active_record/json.rb', line 15
|
#write(locale, value, **options) ⇒ String, ...
Note:
Translation may be string, integer or boolean-valued since value is stored on a JSON hash.
Returns Updated value.
|
# File 'lib/mobility/backends/active_record/json.rb', line 24
|