We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e9cd8b commit e739fbaCopy full SHA for e739fba
test/cases/batches_test_sqlserver.rb
@@ -0,0 +1,28 @@
1
+require 'cases/sqlserver_helper'
2
+require 'models/post'
3
+
4
+class BatchesTestSqlserver < ActiveRecord::TestCase
5
+end
6
7
+class EachTest < ActiveRecord::TestCase
8
9
+ COERCED_TESTS = [
10
+ :test_find_in_batches_should_quote_batch_order
11
+ ]
12
13
+ include SqlserverCoercedTest
14
15
+ fixtures :posts
16
17
+ def test_coerced_find_in_batches_should_quote_batch_order
18
+ c = Post.connection
19
+ assert_sql(/ORDER BY \[posts\]\.\[id\]/) do
20
+ Post.find_in_batches(:batch_size => 1) do |batch|
21
+ assert_kind_of Array, batch
22
+ assert_kind_of Post, batch.first
23
+ end
24
25
26
27
28
0 commit comments