use named scopes, read a bit about them, lets you chain them like this Home.ranged(6..9).paginate( etc etc)
On Tue, Sep 7, 2010 at 6:42 PM, Mark Moore <[email protected]> wrote: > I am Using will_paginate plugin in a call like : > > @homes = Home.paginate(:all, :conditions => conditions.... > > I want to have minimum and maximum price within all @homes searched. How > would I do that efficiently? > Since I do pagination, the @homes variable doesn't contain all the > "homes" objects, but only partial ones for pagination. Do I have to do > another query with same conditions without pagination to get it? > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rubyonrails-talk%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

