Hi All,
I''m trying to use pagination on a SQL Server database. The paginator
correctly passes the page number and updates the pagination links but
the records displayed don''t change.
Looking into the sql statements in the log shows something like:
SELECT *
FROM (SELECT TOP 5 *
FROM (SELECT TOP 10 *
FROM contacts
ORDER BY first_name) AS tmp1
ORDER BY first_name) tmp2
ORDER BY first_name
This obviously won''t work and keeps returning the first 5 records.
Also, if the :order-by => ''field'' is skipped,
sqlserver_adapter.rb:294:in `add_limit_with_offset!''
breaks with a
undefined method `[]'' for nil:NilClass
error.
Is pagination broken under SQL Server or am I missing something? If
so, are there any workarounds or patches?