Class: ActiveRecord::Associations::AssociationScope::BindSubstitution
- Inherits:
-
Object
- Object
- ActiveRecord::Associations::AssociationScope::BindSubstitution
- Defined in:
- lib/active_record/associations/association_scope.rb
Instance Method Summary collapse
- #bind_value(scope, column, value, alias_tracker) ⇒ Object
-
#initialize(block) ⇒ BindSubstitution
constructor
A new instance of BindSubstitution.
Constructor Details
#initialize(block) ⇒ BindSubstitution
Returns a new instance of BindSubstitution.
9 10 11 |
# File 'lib/active_record/associations/association_scope.rb', line 9 def initialize(block) @block = block end |
Instance Method Details
#bind_value(scope, column, value, alias_tracker) ⇒ Object
13 14 15 16 17 |
# File 'lib/active_record/associations/association_scope.rb', line 13 def bind_value(scope, column, value, alias_tracker) substitute = alias_tracker.connection.substitute_at(column) scope.bind_values += [[column, @block.call(value)]] substitute end |