diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 13:32:48 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 13:33:08 -0700 |
commit | b9eec677c4ca28203124a9b5b160a57ca13b95f1 (patch) | |
tree | b30234b82506745724d2ebdf6c4d83b05cf19e0f /activerecord/lib/active_record | |
parent | af3e39358cacb93e39f6c7952314adb3892e3a6f (diff) | |
download | rails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.tar.gz rails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.tar.bz2 rails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.zip |
avoid direct use of arel constants
Diffstat (limited to 'activerecord/lib/active_record')
-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] |