You might want to split those two into named_scopes of their own
though - for more modularity and possible scope chaining opportunities
elsewhere in the code.
Handling whether one of those arguments, which I presume are user
entered, is blank can be handled in the controller.

On Jul 16, 5:32 pm, Jermaine <jermaine2...@gmail.com> wrote:
> aaah I-C.
> Okay thanks for clearing that up! great stuff
>
> On 16 jul, 14:16, Andy Jeffries <a...@andyjeffries.co.uk> wrote:
>
>
>
> > > Thanks for the suggestion. However what did you mean specifically with
> > > your last comment?
>
> > > >> With anything like this any time you save when building up the
> > > conditions
> > > >> will be dwarfed by the time it takes to run the actual query
>
> > Putting words in Frederick's mouth, but it simply means that it's
> > ridiculously quick to build up the conditions object in Ruby compared to
> > actually executing the SQL on the database (and communicating the SQL and
> > response over the socket).
>
> > Cheers,
>
> > Andy

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to