diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-16 15:11:48 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-16 15:11:48 -0800 |
commit | 9c023cc4d2949d10fa6cfa013655d86aae8d8019 (patch) | |
tree | 3d1e5b41477ec49813e1d4baf32bdf96969fba8a /activerecord/lib | |
parent | ceb2f0f2169203d697acb1602348042609b3c076 (diff) | |
download | rails-9c023cc4d2949d10fa6cfa013655d86aae8d8019.tar.gz rails-9c023cc4d2949d10fa6cfa013655d86aae8d8019.tar.bz2 rails-9c023cc4d2949d10fa6cfa013655d86aae8d8019.zip |
explicitly allowing lolqueries
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 6a905b8588..f76681e880 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -209,16 +209,7 @@ module ActiveRecord def collapse_wheres(arel, wheres) equalities = wheres.grep(Arel::Nodes::Equality) - groups = equalities.group_by do |equality| - equality.left - end - - groups.each do |_, eqls| - test = eqls.inject(eqls.shift) do |memo, expr| - memo.or(expr) - end - arel.where(test) - end + arel.where(Arel::Nodes::And.new(equalities)) unless equalities.empty? (wheres - equalities).each do |where| where = Arel.sql(where) if String === where |