diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-20 13:42:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-20 13:42:42 -0700 |
commit | d059fa6f0c923240ef39a372276a151827a6df5b (patch) | |
tree | eae25f2fad1ee5d6844f20f3f359cfcf69be2c25 | |
parent | fe67bc2a86f86bdc9c01c4ae54025f46cb7f0f55 (diff) | |
download | rails-d059fa6f0c923240ef39a372276a151827a6df5b.tar.gz rails-d059fa6f0c923240ef39a372276a151827a6df5b.tar.bz2 rails-d059fa6f0c923240ef39a372276a151827a6df5b.zip |
disconnect join_constraints from the instance
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 4 |
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 |