Skip to content

Commit

Permalink
eliminate conditional in JoinHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jul 24, 2013
1 parent b8aebb0 commit 67978d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/associations/join_helper.rb
Expand Up @@ -19,7 +19,7 @@ def construct_tables

if reflection.source_macro == :has_and_belongs_to_many
tables << alias_tracker.aliased_table_for(
(reflection.source_reflection || reflection).join_table,
reflection.source_reflection.join_table,
table_alias_for(reflection, true)
)
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/reflection.rb
Expand Up @@ -269,7 +269,7 @@ def through_reflection
end

def source_reflection
nil
self
end

# A chain of reflections from this one back to the owner. For more see the explanation in
Expand Down

0 comments on commit 67978d6

Please sign in to comment.