diff options
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 0b5e9b4fb2..8ccc62c9d1 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -121,8 +121,10 @@ module ActiveRecord when Hash, Array, Symbol if array_of_strings?(join) join_string = join.join(' ') - arel = arel.join(join_string) + arel = arel.join(Arel::SqlLiteral.new(join_string)) end + when String + arel = arel.join(Arel::SqlLiteral.new(join)) else arel = arel.join(join) end |