123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::Associations::AssociationScope::BindSubstitution

Relationships & Source Files
Inherits: Object
Defined in: activerecord/lib/active_record/associations/association_scope.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(block) ⇒ BindSubstitution

[ GitHub ]

  
# File 'activerecord/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)

[ GitHub ]

  
# File 'activerecord/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