Limit number of results from dynamic finders

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs