diff options
author | Dan Olson <olson_dan@yahoo.com> | 2014-10-19 19:44:27 -0500 |
---|---|---|
committer | Dan Olson <olson_dan@yahoo.com> | 2014-10-20 05:38:34 -0500 |
commit | 032605f08bdb8a911554276122b9feddff3eb1da (patch) | |
tree | e1098b7714f812e14d2a637c075213c4b968654a /activerecord/test | |
parent | 74a527cc63ef56f3d0a42cf638299958dc7cb08c (diff) | |
download | rails-032605f08bdb8a911554276122b9feddff3eb1da.tar.gz rails-032605f08bdb8a911554276122b9feddff3eb1da.tar.bz2 rails-032605f08bdb8a911554276122b9feddff3eb1da.zip |
Fix Relation.rewhere to work with Range values
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relation/where_chain_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation/where_chain_test.rb b/activerecord/test/cases/relation/where_chain_test.rb index b9e69bdb08..478ac1bc42 100644 --- a/activerecord/test/cases/relation/where_chain_test.rb +++ b/activerecord/test/cases/relation/where_chain_test.rb @@ -149,5 +149,12 @@ module ActiveRecord assert_bound_ast value, Post.arel_table['title'], Arel::Nodes::Equality assert_equal 'alone', bind.last end + + def test_rewhere_with_range + relation = Post.where(comments_count: 1..3).rewhere(comments_count: 3..5) + + assert_equal 1, relation.where_values.size + assert_equal Post.where(comments_count: 3..5), relation + end end end |