Fixed a problem with using "next" and "previous" when working with SQLite3 by changing the conditions to the more correct way of ensuring that ActiveRecord generates the correct queries for booleans. Verified working with SQLite3 only.