diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-20 15:53:27 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-20 15:53:27 -0700 |
commit | fbb9896dddc4feb71c9526d7773ecd65888a3726 (patch) | |
tree | 8194dbec75bdc6a5ad703e9e6fb0ef2e2cfe2fe7 /lib | |
parent | 2f32aa068513c6bd1fab63087756417e01af06c8 (diff) | |
download | rails-fbb9896dddc4feb71c9526d7773ecd65888a3726.tar.gz rails-fbb9896dddc4feb71c9526d7773ecd65888a3726.tar.bz2 rails-fbb9896dddc4feb71c9526d7773ecd65888a3726.zip |
partial unfuck
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/algebra/predicates.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/arel/algebra/predicates.rb b/lib/arel/algebra/predicates.rb index b60d976b4e..df2618a148 100644 --- a/lib/arel/algebra/predicates.rb +++ b/lib/arel/algebra/predicates.rb @@ -55,11 +55,8 @@ module Arel private def same_elements?(a1, a2) - [:select, :inject, :size].each do |m| - return false unless [a1, a2].each {|a| a.respond_to?(m) } - end - a1.inject({}) { |h,e| h[e] = a1.select { |i| i == e }.size; h } == - a2.inject({}) { |h,e| h[e] = a2.select { |i| i == e }.size; h } + a1.inject({}) { |h,e| h[e] = a1.count(e); h } == + a2.inject({}) { |h,e| h[e] = a2.count(e); h } end end |