aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index bdd171135c..502a220f5b 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -149,7 +149,7 @@ module ActiveRecord
end
def custom_join_sql(*joins)
- arel = table
+ arel = table.select_manager
joins.each do |join|
next if join.blank?
@@ -160,12 +160,12 @@ module ActiveRecord
when Hash, Array, Symbol
if array_of_strings?(join)
join_string = join.join(' ')
- arel = arel.join(Arel::SqlLiteral.new(join_string))
+ arel.join(Arel::SqlLiteral.new(join_string))
end
when String
- arel = arel.join(Arel::SqlLiteral.new(join))
+ arel.join(Arel::SqlLiteral.new(join))
else
- arel = arel.join(join)
+ arel.join(join)
end
end