diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-20 16:23:23 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-20 16:23:23 -0700 |
commit | 0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c (patch) | |
tree | d81c026479834250149d90526c98247a1d004dd0 /spec/arel | |
parent | cd13c3e1dad07c1168a318feb543d3b1ede9f2cf (diff) | |
download | rails-0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c.tar.gz rails-0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c.tar.bz2 rails-0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c.zip |
supporting ranges for IN statements
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/visitors/to_sql_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/arel/visitors/to_sql_spec.rb b/spec/arel/visitors/to_sql_spec.rb index b277810863..25642ee947 100644 --- a/spec/arel/visitors/to_sql_spec.rb +++ b/spec/arel/visitors/to_sql_spec.rb @@ -72,6 +72,20 @@ module Arel "users"."id" IN (NULL) } end + + it 'can handle two dot ranges' do + node = @attr.in 1..3 + @visitor.accept(node).should be_like %{ + "users"."id" BETWEEN 1 AND 3 + } + end + + it 'can handle three dot ranges' do + node = @attr.in 1...3 + @visitor.accept(node).should be_like %{ + "users"."id" >= 1 AND "users"."id" < 3 + } + end end describe 'Equality' do |