diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 13:32:48 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-08-14 13:17:30 +0200 |
commit | e8ffe7d6b6302de789a612be0ad98349b10daa9c (patch) | |
tree | 91f2d87aa6dffa7febdab941c5c54cc7fcf87ba1 | |
parent | c8d5ee3e9e4afd920458e49236139d4cbffac4ca (diff) | |
download | rails-e8ffe7d6b6302de789a612be0ad98349b10daa9c.tar.gz rails-e8ffe7d6b6302de789a612be0ad98349b10daa9c.tar.bz2 rails-e8ffe7d6b6302de789a612be0ad98349b10daa9c.zip |
avoid direct use of arel constants
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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] |