From fbb9896dddc4feb71c9526d7773ecd65888a3726 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 20 Jul 2010 15:53:27 -0700 Subject: partial unfuck --- lib/arel/algebra/predicates.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3