diff options
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 502a220f5b..b7c15fb808 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -159,14 +159,13 @@ module ActiveRecord 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) |