module Mobility::Plugins::ActiveRecord

Adds a scope which enables querying on translated attributes using where and not as if they were normal attributes. Under the hood, this plugin uses the generic build_node and apply_scope methods implemented in each backend class to build ActiveRecord queries from Arel nodes. The plugin also adds +find_by_<attribute>+ shortcuts for translated attributes.

The query scope applies to all translated attributes once the plugin has been enabled for any one attribute on the model.

Private Instance Methods

active_record_class?(klass) click to toggle source
# File lib/mobility/plugins/active_record.rb, line 38
def active_record_class?(klass)
  klass < ::ActiveRecord::Base
end