From 2fa7ccf7aee3696e99f1b528db848aff5a671f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 27 Mar 2012 12:49:43 +0200 Subject: Remove Arel::Relation constant from PredicateBuilder. --- activerecord/lib/active_record/relation/predicate_builder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 1088773bc7..b40bf2b3cf 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -39,7 +39,7 @@ module ActiveRecord attribute.in(value.arel.ast) when Array, ActiveRecord::Associations::CollectionProxy values = value.to_a.map {|x| x.is_a?(ActiveRecord::Model) ? x.id : x} - ranges, values = values.partition {|v| v.is_a?(Range) || v.is_a?(Arel::Relation)} + ranges, values = values.partition {|v| v.is_a?(Range)} values_predicate = if values.include?(nil) values = values.compact @@ -59,7 +59,7 @@ module ActiveRecord array_predicates = ranges.map { |range| attribute.in(range) } array_predicates << values_predicate array_predicates.inject { |composite, predicate| composite.or(predicate) } - when Range, Arel::Relation + when Range attribute.in(value) when ActiveRecord::Model attribute.eq(value.id) -- cgit v1.2.3