Please quote when replying.

Christian Fazzini wrote:
> If thats the case, when should one use a named scope over a method?
> 
> For example:
> 
> Product.find_by_category(category).
> 
> find_by_category can either be a named scope or a method in the
> Product model. I was under the impression that named scopes cant
> accept an attribute and this was the main difference. Apparently, it
> can!
> 
> So when does one use named scopes over methods?

A named_scope is a method, or as near as matters.  Use whichever is 
easier to implement and otherwise more suitable to your use case.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to