aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJuanjo Bazán <jjbazan@gmail.com>2012-03-27 12:49:43 +0200
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-27 14:13:28 -0700
commit2fa7ccf7aee3696e99f1b528db848aff5a671f77 (patch)
treecf5a32bd83d3d39ad2001f434d3aa45d3f32b22b /activerecord
parent96b72efc001473061e69bda0c601d8bda64027f3 (diff)
downloadrails-2fa7ccf7aee3696e99f1b528db848aff5a671f77.tar.gz
rails-2fa7ccf7aee3696e99f1b528db848aff5a671f77.tar.bz2
rails-2fa7ccf7aee3696e99f1b528db848aff5a671f77.zip
Remove Arel::Relation constant from PredicateBuilder.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/predicate_builder.rb4
1 files changed, 2 insertions, 2 deletions
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)