From 0e98ef149cd44dc04d40a8553e1743c5cb6d4a7c Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 20 Sep 2010 16:23:23 -0700 Subject: supporting ranges for IN statements --- spec/arel/visitors/to_sql_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'spec/arel') 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 -- cgit v1.2.3