This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 66ee5890c5f21995b7fe0c486547f1287afe2b55
tree 81b44888712ff3ea7093209b3235858948354d25
parent 1fb275541a58e6a2100261c6117e96e6c014cc6c
tree 81b44888712ff3ea7093209b3235858948354d25
parent 1fb275541a58e6a2100261c6117e96e6c014cc6c
... |
... |
|
... |
... |
|
... |
... |
|
... |
... |
|












it’s not better with assert on :
Post.find(:first, :conditions => { :author_id => 1})
because we can’t assume that Post(1) is allways to author_id(1).
@shingara well, actually we can since we use fixtures :)
I would suggest dropping the “scoped_” preffix, as it IMO improves readability:
Still, the “scoped_” prefix allows for clarity of what’s happening.
I prefer it with the “scoped_” prefix, as it’s more in keeping with related declarations (e.g. “named_scope”, “default_scope” etc.)
Using fabiokungs examples, I think it actually rolls of the tongue worse without the prefixes!
I am ok with “scoped_” prefix
I’d agree with fabiokung except that I tend to use “by_x” for named scopes that add an :order. E.g. “by_created”, so having “by_name” use conditions instead of order could get weird, for me at least. “with_” might make more sense for conditions anyway.
To be clear, I don’t mind “scoped_by” or “find_by” since the “by” is prefixed.