diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-30 19:33:46 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-30 19:34:05 +0000 |
commit | ec057ada07a20d943904d55f0dc9690e8ee50826 (patch) | |
tree | be181b6477a2d12243414405e256091bc5d4e8c2 | |
parent | 1bd8a50a995a047c8546e8901582b9d1e16af2df (diff) | |
download | rails-ec057ada07a20d943904d55f0dc9690e8ee50826.tar.gz rails-ec057ada07a20d943904d55f0dc9690e8ee50826.tar.bz2 rails-ec057ada07a20d943904d55f0dc9690e8ee50826.zip |
Rely on arel to generate the correct sql when an empty array is supplied to IN predicate
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 9e855209f9..65e5c0495c 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -25,7 +25,7 @@ module ActiveRecord case value when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope values = value.to_a - values.any? ? attribute.in(values) : attribute.eq(nil) + attribute.in(values) when Range # TODO : Arel should handle ranges with excluded end. if value.exclude_end? |