Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

paginate_by_sql fails when using different databases #117

Open
fabiob opened this Issue · 0 comments

1 participant

@fabiob

My rails application, on my development environment, runs on SQLite, but access some legacy Oracle database (using ActiveRecord::Base.establish_connection on the legacy models).

Since it's a legacy database, used mostly for querying, I use find_by_sql a lot. I started working with will_paginate on some queries, switched my calls to find_by_sql for paginate_by_sql, but Oracle started complaining about SQL syntax errors.

Digging through the logs, I noticed that will_paginate added 'LIMIT 20 OFFSET 20' to my query - the SQLite way of pagination. Looks like it's trying to use the adapter configured for ActiveRecord::Base, and not for my additional model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.