These are chat archives for rails-sqlserver/activerecord-sqlserver-adapter

26th
Jun 2018
Jeffrey M Castro
@jeffreycastro
Jun 26 2018 06:27

hello guys, i have a question about the limit method as i am having an issue with pagination.

the code records.page(1).limit(10)
gives this sql command: ... [users].[id] IN (1, 2, 3, 4, 9, 3, 5, 8, 10, 6)

notice that the ID = 3 is used twice.. resulting in incorrect pagination (returning 9 records instead of 10), any help is appreciated on how to fix this.

i am using rails 5.1.4 with docker image for mssqlserver 2017