aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-20 13:42:42 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-20 13:42:42 -0700
commitd059fa6f0c923240ef39a372276a151827a6df5b (patch)
treeeae25f2fad1ee5d6844f20f3f359cfcf69be2c25 /activerecord/lib/active_record
parentfe67bc2a86f86bdc9c01c4ae54025f46cb7f0f55 (diff)
downloadrails-d059fa6f0c923240ef39a372276a151827a6df5b.tar.gz
rails-d059fa6f0c923240ef39a372276a151827a6df5b.tar.bz2
rails-d059fa6f0c923240ef39a372276a151827a6df5b.zip
disconnect join_constraints from the instance
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb2
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index 5d1e41dabf..0969fc4ebd 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -168,7 +168,7 @@ module ActiveRecord
chain = child.reflection.chain
foreign_table = node.table
foreign_klass = node.base_klass
- child.join_constraints(foreign_table, foreign_klass, child.join_type, child.tables, child.reflection.scope_chain, chain)
+ child.join_constraints(foreign_table, foreign_klass, child, child.join_type, child.tables, child.reflection.scope_chain, chain)
.concat make_joins(child)
}
end
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
index 7420e0df72..4a70dc9e26 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -25,7 +25,7 @@ module ActiveRecord
super && reflection == other.reflection
end
- def join_constraints(foreign_table, foreign_klass, join_type, tables, scope_chain, chain)
+ def join_constraints(foreign_table, foreign_klass, node, join_type, tables, scope_chain, chain)
joins = []
tables = tables.reverse
@@ -52,7 +52,7 @@ module ActiveRecord
if item.is_a?(Relation)
item
else
- ActiveRecord::Relation.create(klass, table).instance_exec(self, &item)
+ ActiveRecord::Relation.create(klass, table).instance_exec(node, &item)
end
end