aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-15 13:01:13 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-15 13:01:13 -0200
commitda5e5c5f779355a2e99e63a90612cbeaeb0fc986 (patch)
tree216e24f855e84473808766d7a58d20c953b6a2d8 /activerecord/lib/active_record/associations
parent823604ec1659109eedeb2db91de325d413c73452 (diff)
downloadrails-da5e5c5f779355a2e99e63a90612cbeaeb0fc986.tar.gz
rails-da5e5c5f779355a2e99e63a90612cbeaeb0fc986.tar.bz2
rails-da5e5c5f779355a2e99e63a90612cbeaeb0fc986.zip
Revert "Merge pull request #7983 from georgebrock/bug7950-squashed"
This reverts commit 88a296dccc401da143d90cad54b693ff06bf2b58, reversing changes made to 666a7e34f553cef4c8878362eafc79c7e3f310c3. Conflicts: activerecord/CHANGELOG.md Reason: this has been resulting in some hard to track bugs and is introducing a possible breackage in a stable version.
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r--activerecord/lib/active_record/associations/association_scope.rb16
1 files changed, 1 insertions, 15 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb
index 226639ad37..f9cffa40c8 100644
--- a/activerecord/lib/active_record/associations/association_scope.rb
+++ b/activerecord/lib/active_record/associations/association_scope.rb
@@ -33,18 +33,6 @@ module ActiveRecord
private
- def column_for(table_name, column_name)
- columns = alias_tracker.connection.schema_cache.columns_hash[table_name]
- columns[column_name]
- end
-
- def bind(scope, column, value)
- substitute = alias_tracker.connection.substitute_at(
- column, scope.bind_values.length)
- scope.bind_values += [[column, value]]
- substitute
- end
-
def add_constraints(scope)
tables = construct_tables
@@ -79,9 +67,7 @@ module ActiveRecord
conditions = self.conditions[i]
if reflection == chain.last
- column = column_for(table.table_name, key.to_s)
- bind_val = bind(scope, column, owner[foreign_key])
- scope = scope.where(table[key].eq(bind_val))
+ scope = scope.where(table[key].eq(owner[foreign_key]))
if reflection.type
scope = scope.where(table[reflection.type].eq(owner.class.base_class.name))