Class: Mobility::Backends::Sequel::Hstore
- Inherits:
-
PgHash
- Object
- PgHash
- Mobility::Backends::Sequel::Hstore
- Defined in:
- lib/mobility/backends/sequel/hstore.rb
Defined Under Namespace
Classes: HStoreOp
Backend Accessors collapse
-
#read(locale, options = {}) ⇒ Object
Gets the translated value for provided locale from configured backend.
-
#write(locale, value, options = {}) ⇒ Object
Updates translation for provided locale without calling backend’s methods to persist the changes.
Class Method Summary collapse
Methods included from Mobility::Backends::Sequel
Class Method Details
.build_op(attr, locale) ⇒ Mobility::Backends::Sequel::Hstore::HStoreOp
30 31 32 33 |
# File 'lib/mobility/backends/sequel/hstore.rb', line 30 def self.build_op(attr, locale) column_name = column_affix % attr HStoreOp.new(column_name.to_sym)[locale.to_s] end |
Instance Method Details
#read(locale, options = {}) ⇒ Object
Gets the translated value for provided locale from configured backend.
|
# File 'lib/mobility/backends/sequel/hstore.rb', line 16
|
#write(locale, value, options = {}) ⇒ Object
Updates translation for provided locale without calling backend’s methods to persist the changes.
22 23 24 |
# File 'lib/mobility/backends/sequel/hstore.rb', line 22 def write(locale, value, = {}) super(locale, value && value.to_s, **) end |