On Wed, Sep 25, 2013 at 10:33 AM, Roman <[email protected]> wrote:

Michael has given one example. Here's my turn. When having nested routes
> like `/trees/42/apples`, I'm doing a `Tree.find(42)` and it raises if
> there's no such tree. In other case, when the object is associated to
> current_user, there's no need to put its id in the routes, but for symmetry
> I would still like to call something that conveniently raises if the record
> is not present.
>

There is something about the associations API that doesn't quite match with
this proposal in my view.

The problem I see is that the associations API is only partially a finder
API, due to the cached records. Once you take into account the method does
not always fire a query, the semantics of a bang variant start to be
unclear to me.

Bang methods make sense for me for stuff that goes to the database.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to