Module: Mobility::Backends::KeyValue::ClassMethods
- Defined in:
- lib/mobility/backends/key_value.rb
Backend Configuration collapse
-
#apply_plugin(name) ⇒ Object
Apply custom processing for plugin.
- #configure(options) ⇒ Object
- #table_alias(attr, locale) ⇒ Object
Instance Method Details
#apply_plugin(name) ⇒ Object
Apply custom processing for plugin
115 116 117 118 119 120 121 122 |
# File 'lib/mobility/backends/key_value.rb', line 115 def apply_plugin(name) if name == :cache include self::Cache true else super end end |
#configure(options) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/mobility/backends/key_value.rb', line 96 def configure() [:type] &&= [:type].to_sym [:association_name] &&= [:association_name].to_sym [:class_name] &&= Util.constantize([:class_name]) if !([:type] || ([:class_name] && [:association_name])) # TODO: Remove warning and raise ArgumentError in v1.0 warn %{ WARNING: In previous versions, the Mobility KeyValue backend defaulted to a text type column, but this behavior is now deprecated and will be removed in the next release. Either explicitly specify the type by passing type: :text in each translated model, or set a default option in your configuration. } [:type] = :text end end |
#table_alias(attr, locale) ⇒ Object
124 125 126 |
# File 'lib/mobility/backends/key_value.rb', line 124 def table_alias(attr, locale) table_alias_affix % "#{attr}_#{Mobility.normalize_locale(locale)}" end |