Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove Arel::Relation constant from PredicateBuilder.

  • Loading branch information...
commit 2fa7ccf7aee3696e99f1b528db848aff5a671f77 1 parent 96b72ef
@xuanxu xuanxu authored tenderlove committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/relation/predicate_builder.rb
View
4 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -39,7 +39,7 @@ def self.build(attribute, value)
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 @@ def self.build(attribute, value)
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)
Please sign in to comment.
Something went wrong with that request. Please try again.