[LRUG] A feature of Rails callbacks i wasn't aware of - anyone else?

Max Williams toastkid.williams at gmail.com
Mon Jun 15 00:44:21 PDT 2009


That's very interesting, thanks Glenn.  It looks like this discussion
already happened a year and a half ago :)

I'm a little confused reading that as to whether they're talking about
controller filters or model callbacks though:  the talk of redirecting
sounds more like controller filters, whereas i'm talking about model
callbacks.

2009/6/15 Glenn @ Ruby Pond Ltd <glenn at rubypond.com>

> I'm fairly certain this is a throwback to the *old* way filters used
> to work, and is mostly there for legacy reasons. The generally
> accepted approach is to make it redirect rather than return.
>
> And to avoid @model.save returning false and breaking the chain I
> always use @model.save! and rescue_from
>
> Here's a thread I quickly found discussing the change:
> http://www.ruby-forum.com/topic/128746
>
> Glenn
> --
> Ruby Pond Ltd
> 7 Clarence Pde, Cheltenham, GL5 03NY
> United Kingdom
>
> T: 0207 183 2224
> F: 0207 183 2223
> W: http://rubypond.com/
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20090615/f858f3b9/attachment-0003.html>


More information about the Chat mailing list