ActiveRecord extension to find out near by (proximal) records (previous and next) from the ActiveRelation scopes (tried to use AREL as much as possible).
The benefit of this gem, it can take any scope, and it does subquery for taking previous and next records. You don't need to add anything, just include module and use magic function that will do everything for you.
Currently supported adapters: mysql2
Tested Ruby: 1.9.3, 2.0.0, 2.1.1
Tested ActiveRecord: 3.2, 4.0, 4.1
Current roadmap is to write more specs and add sqlite3 adapter.
Download proximal_records gem