Forum: Ruby on Rails Help with :limit :ofset loop?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
bxsitecover (Guest)
on 2007-07-31 13:56
(Received via mailing list)
This is the code in my model to display 10 records from a db table at
a time.

 def self.find_5
    :order => 'id',
    :limit => 5, :offset => 0)

I want to make a loop so that say if my table contains 45 records and
the limit is find 5 records and the offset changes on a weekly basis
and one day overlaps my last record it will continue and pull from the
first record and so on.

Thank you for reading.
This topic is locked and can not be replied to.