diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-10 14:44:42 -0800 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-16 01:49:27 +0530 |
commit | 0042054ea873a8d25d9bbdc4c7fe0febe1b76042 (patch) | |
tree | 6c11b137813a09f10f1964138d9342e0e94ef88d | |
parent | cea73f82ad65bf8bca707f6f8f3afd86f3e82bdb (diff) | |
download | rails-0042054ea873a8d25d9bbdc4c7fe0febe1b76042.tar.gz rails-0042054ea873a8d25d9bbdc4c7fe0febe1b76042.tar.bz2 rails-0042054ea873a8d25d9bbdc4c7fe0febe1b76042.zip |
remove lasgn since AST is mutated
-rw-r--r-- | activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb | 10 | ||||
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb index 98536d23bc..4839068f6d 100644 --- a/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb @@ -135,9 +135,15 @@ module ActiveRecord conditions << process_conditions(options[:conditions], aliased_table_name) end - join = relation.join(target_table, join_type) + ands = relation.create_and(conditions) - join.on(*conditions) + join = relation.create_join( + relation.froms.first, + target_table, + relation.create_on(ands), + join_type) + + relation.from join end def join_has_and_belongs_to_many_to(relation) diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index dce9ac4808..51a39be065 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -266,7 +266,7 @@ module ActiveRecord # FIXME: refactor this to build an AST join_dependency.join_associations.each do |association| - manager = association.join_to(manager) + association.join_to(manager) end return manager unless join_ast |