Module: AdaptiveAlias::ActiveModelPatches::ApplyScope

Included in:
ActiveRecord::Associations::AssociationScope
Defined in:
lib/adaptive_alias/active_model_patches/apply_scope.rb

Instance Method Summary collapse

Instance Method Details

#apply_scope(scope, table, key, value) ⇒ Object



6
7
8
9
10
# File 'lib/adaptive_alias/active_model_patches/apply_scope.rb', line 6

def apply_scope(scope, table, key, value)
  klass = table.instance_variable_get(:@klass) || table.klass
  key = klass.attribute_aliases[key] || key
  super(scope, table, key, value)
end