From e8ffe7d6b6302de789a612be0ad98349b10daa9c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 13 Aug 2010 13:32:48 -0700 Subject: avoid direct use of arel constants --- activerecord/lib/active_record/relation/spawn_methods.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb index f857e50dea..b4da8e4d1b 100644 --- a/activerecord/lib/active_record/relation/spawn_methods.rb +++ b/activerecord/lib/active_record/relation/spawn_methods.rb @@ -22,8 +22,10 @@ module ActiveRecord merged_wheres = @where_values r.where_values.each do |w| - if w.is_a?(Arel::Predicates::Equality) - merged_wheres = merged_wheres.reject {|p| p.is_a?(Arel::Predicates::Equality) && p.operand1.name == w.operand1.name } + if w.respond_to?(:operator) && w.operator == :== + merged_wheres = merged_wheres.reject { |p| + p.respond_to?(:operator) && p.operator == :== && p.operand1.name == w.operand1.name + } end merged_wheres += [w] -- cgit v1.2.3