File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,19 @@ class OffsetAndLimitTestSqlserver < ActiveRecord::TestCase
3333 assert_equal Book . all [ 5 , 3 ] . map ( &:id ) , books . map ( &:id )
3434 end
3535
36- should 'allow sql literal for offset' do
37- assert_sql ( /WHERE \[ __rnt\] \. \[ __rn\] > \( 3-2\) / ) { Book . limit ( 10 ) . offset ( Arel . sql ( '3-2' ) ) . all }
36+ # ActiveRecord Regression 3.2.3?
37+ # https://github.com/rails/rails/commit/a2c2f406612a1855fbc6fe816cf3e15b4ef531d3#commitcomment-1208811
38+ should_eventually 'allow sql literal for offset' do
39+ assert_sql ( /WHERE \[ __rnt\] \. \[ __rn\] > \( 3-2\) / ) { Book . limit ( 10 ) . offset ( Arel ::Nodes ::Ascending . new ( '3-2' ) ) . all }
3840 assert_sql ( /WHERE \[ __rnt\] \. \[ __rn\] > \( SELECT 8 AS \[ count\] \) / ) do
3941 books = Book . all :limit => 3 , :offset => Arel . sql ( 'SELECT 8 AS [count]' )
4042 assert_equal 2 , books . size , 'remember there are only 10 books and offset is 8'
4143 end
4244 end
4345
44- should 'not convert strings which look like integers to integers' do
46+ # ActiveRecord Regression 3.2.3?
47+ # https://github.com/rails/rails/commit/a2c2f406612a1855fbc6fe816cf3e15b4ef531d3#commitcomment-1208811
48+ should_eventually 'not convert strings which look like integers to integers' do
4549 assert_sql ( /WHERE \[ __rnt\] \. \[ __rn\] > \( N''5''\) / ) { Book . limit ( 10 ) . offset ( '5' ) . all }
4650 end
4751
You can’t perform that action at this time.
0 commit comments