Class: Mobility::Backends::ActiveRecord::Jsonb
- Inherits:
-
PgHash
- Object
- PgHash
- Mobility::Backends::ActiveRecord::Jsonb
- Defined in:
- lib/mobility/backends/active_record/jsonb.rb
Backend Accessors collapse
-
#read(locale, **options) ⇒ String, ...
Value of translation.
Class Method Summary collapse
-
.build_node(attr, locale) ⇒ Mobility::Plugins::Arel::Nodes::Jsonb
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::Jsonb
Returns Arel node for value of attribute key on jsonb column.
37 38 39 40 |
# File 'lib/mobility/backends/active_record/jsonb.rb', line 37 def self.build_node(attr, locale) column_name = column_affix % attr Plugins::Arel::Nodes::Jsonb.new(model_class.arel_table[column_name], build_quoted(locale)) end |
Instance Method Details
#read(locale, **options) ⇒ String, ...
Note:
Translation may be any json type, but querying will only work on string-typed values.
Returns Value of translation.
|
# File 'lib/mobility/backends/active_record/jsonb.rb', line 15
|
#write(locale, value, **options) ⇒ String, ...
Note:
Translation may be any json type, but querying will only work on string-typed values.
Returns Updated value.
|
# File 'lib/mobility/backends/active_record/jsonb.rb', line 24
|