From 70ab4502749d23464f06d50779aeea0b3275d67c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 7 Dec 2010 14:01:37 -0800 Subject: cleaning up custom_join_sql method --- activerecord/lib/active_record/relation/query_methods.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 0483950db7..2933d427f0 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -163,13 +163,15 @@ module ActiveRecord end def custom_join_sql(joins) - arel = table.select_manager + joins = joins.reject { |join| join.blank? } - joins.each do |join| - next if join.blank? + return if joins.empty? - @implicit_readonly = true + @implicit_readonly = true + arel = table.select_manager + + joins.each do |join| case join when Array join = Arel.sql(join.join(' ')) if array_of_strings?(join) -- cgit v1.2.3