Class: Mobility::Backends::ActiveRecord::Serialized
- Inherits:
-
Object
- Object
- Mobility::Backends::ActiveRecord::Serialized
- Includes:
- Mobility::Backends::ActiveRecord
- Defined in:
- lib/mobility/backends/active_record/serialized.rb
Overview
Implements Serialized backend for ActiveRecord models.
Backend Configuration collapse
Cache Methods collapse
-
#translations ⇒ Hash
Returns column value as a hash.
Class Method Summary collapse
Methods included from Mobility::Backends::ActiveRecord
Class Method Details
.build_node(attr, _locale) ⇒ Object
47 48 49 50 |
# File 'lib/mobility/backends/active_record/serialized.rb', line 47 def self.build_node(attr, _locale) raise ArgumentError, "You cannot query on mobility attributes translated with the Serialized backend (#{attr})." end |
.configure(options) ⇒ Object
41 42 43 44 |
# File 'lib/mobility/backends/active_record/serialized.rb', line 41 def self.configure() super Serialized.configure() end |
.valid_keys ⇒ Object
33 34 35 |
# File 'lib/mobility/backends/active_record/serialized.rb', line 33 def self.valid_keys super + [:format] end |
Instance Method Details
#translations ⇒ Hash
Returns column value as a hash
66 67 68 |
# File 'lib/mobility/backends/active_record/serialized.rb', line 66 def translations model.read_attribute(column_name) end |