Forum: Ruby on Rails limit number of results from dynamic finders

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.
6fe135329ce89e00b74839a41c8e3872?d=identicon&s=25 Ehud Rosenberg (ehudros)
on 2007-05-05 01:53
Hi everyone,
I'm looking for a way to limit the number of results returned by the
select genereted when I use the following syntax:
User.posts.each { |post| ... }

I'm not sure those are dynamic finders per se, but I'm not familier with
the correct term. any way, I'd like to only select the first 5 posts
withut using find_by_sql or find(:all, :limit => 5).

Is that possible?

This topic is locked and can not be replied to.