aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-08-13 13:32:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-08-13 13:33:08 -0700
commitb9eec677c4ca28203124a9b5b160a57ca13b95f1 (patch)
treeb30234b82506745724d2ebdf6c4d83b05cf19e0f /activerecord
parentaf3e39358cacb93e39f6c7952314adb3892e3a6f (diff)
downloadrails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.tar.gz
rails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.tar.bz2
rails-b9eec677c4ca28203124a9b5b160a57ca13b95f1.zip
avoid direct use of arel constants
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb6
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]