Permalink
Browse files

eliminate conditional in JoinHelper

  • Loading branch information...
1 parent b8aebb0 commit 67978d624582c8aff1abeeadec9447bddd16ef3b @tenderlove tenderlove committed Jul 24, 2013
@@ -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
@@ -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

0 comments on commit 67978d6

Please sign in to comment.