Permalink
Browse files

dry up calls to arel.join()

  • Loading branch information...
1 parent a01547c commit ddc2f2ee50cbc17bb186575f04fcc1d4d887fdeb @tenderlove tenderlove committed Sep 29, 2010
Showing with 4 additions and 5 deletions.
  1. +4 −5 activerecord/lib/active_record/relation/query_methods.rb
@@ -160,14 +160,13 @@ def custom_join_sql(*joins)
case join
when Hash, Array, Symbol
if array_of_strings?(join)
- join_string = join.join(' ')
- arel.join(Arel::SqlLiteral.new(join_string))
+ join = Arel::SqlLiteral.new(join.join(' '))
end
when String
- arel.join(Arel::SqlLiteral.new(join))
- else
- arel.join(join)
+ join = Arel::SqlLiteral.new(join)
end
+
+ arel.join(join)
end
arel.joins(arel)

0 comments on commit ddc2f2e

Please sign in to comment.