aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/through_association_scope.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2010-10-19 15:24:30 +0100
committerJon Leighton <j@jonathanleighton.com>2010-10-19 15:24:30 +0100
commit0ceb34295501a797c9e549c581ecee17f837f01c (patch)
tree99ba5d6e32716b6539decfa987c546166c32a354 /activerecord/lib/active_record/associations/through_association_scope.rb
parent9ff5fdeda99b3d8c5148d4c40956842518d1c788 (diff)
downloadrails-0ceb34295501a797c9e549c581ecee17f837f01c.tar.gz
rails-0ceb34295501a797c9e549c581ecee17f837f01c.tar.bz2
rails-0ceb34295501a797c9e549c581ecee17f837f01c.zip
Bugfix/refactoring
Diffstat (limited to 'activerecord/lib/active_record/associations/through_association_scope.rb')
-rw-r--r--activerecord/lib/active_record/associations/through_association_scope.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/associations/through_association_scope.rb b/activerecord/lib/active_record/associations/through_association_scope.rb
index 2b2229f01f..1365851337 100644
--- a/activerecord/lib/active_record/associations/through_association_scope.rb
+++ b/activerecord/lib/active_record/associations/through_association_scope.rb
@@ -108,8 +108,8 @@ module ActiveRecord
when :belongs_to
joins << inner_join_sql(
right_table_and_alias,
- table_aliases[left], left.source_reflection.association_primary_key,
- table_aliases[right], left.source_reflection.primary_key_name,
+ table_aliases[left], left.association_primary_key,
+ table_aliases[right], left.primary_key_name,
source_type_conditions(left),
reflection_conditions(right_index)
)
@@ -123,7 +123,7 @@ module ActiveRecord
joins << inner_join_sql(
right_table_and_alias,
- table_aliases[left], left.source_reflection.primary_key_name,
+ table_aliases[left], left.primary_key_name,
right_table, left.source_reflection.active_record_primary_key,
polymorphic_conditions(left, left.source_reflection),
reflection_conditions(right_index)
@@ -148,12 +148,12 @@ module ActiveRecord
join_table
),
left_table, left.klass.primary_key,
- join_table, left.source_reflection.association_foreign_key
+ join_table, left.association_foreign_key
)
joins << inner_join_sql(
right_table_and_alias,
- join_table, left.source_reflection.primary_key_name,
+ join_table, left.primary_key_name,
table_aliases[right], right.klass.primary_key,
reflection_conditions(right_index)
)