diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-07 14:01:37 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-07 14:01:37 -0800 |
commit | 70ab4502749d23464f06d50779aeea0b3275d67c (patch) | |
tree | d9684647ce569ffd6ae67c6a630796cdcb16bf18 | |
parent | 7c920631ec3b314cfaa3a60d265de40cba3e8135 (diff) | |
download | rails-70ab4502749d23464f06d50779aeea0b3275d67c.tar.gz rails-70ab4502749d23464f06d50779aeea0b3275d67c.tar.bz2 rails-70ab4502749d23464f06d50779aeea0b3275d67c.zip |
cleaning up custom_join_sql method
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 10 |
1 files changed, 6 insertions, 4 deletions
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) |