Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

dry up calls to arel.join()

  • Loading branch information...
commit ddc2f2ee50cbc17bb186575f04fcc1d4d887fdeb 1 parent a01547c
@tenderlove tenderlove authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 activerecord/lib/active_record/relation/query_methods.rb
View
9 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)
Please sign in to comment.
Something went wrong with that request. Please try again.