aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/interest.rb
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2017-09-14 05:28:16 +0900
committerRyuta Kamizono <kamipo@gmail.com>2017-09-14 05:28:16 +0900
commit7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8 (patch)
tree3e25489974c4408ec8aad97f3a74a1a0a8954e00 /activerecord/test/models/interest.rb
parentca18922ac23be2cde6963fae9b193c9111bec6f8 (diff)
downloadrails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.tar.gz
rails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.tar.bz2
rails-7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8.zip
Make `in_batches` queries to preparable
Before: ```sql SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > 2 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > 4 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > 6 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > 8 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > 10 ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] ``` After: ```sql SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 2], ["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 4], ["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 6], ["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 8], ["LIMIT", 2]] SELECT "posts".* FROM "posts" WHERE "posts"."id" > ? ORDER BY "posts"."id" ASC LIMIT ? [["id", 10], ["LIMIT", 2]] ```
Diffstat (limited to 'activerecord/test/models/interest.rb')
0 files changed, 0 insertions, 0 deletions