Oh, ok. Thanks for the replies!
On Mar 16, 8:17 am, Craig Demyanovich <[email protected]> wrote:
> If what I want to accomplish affects only the model with which I'm working,
> I put the behavior in a callback on the model. If it affects other related
> models, I put it in an observer. Otherwise, I put it in the controller or
> some other non-ActiveRecord library code. In those cases where I've needed a
> URL, either I build and use it in the controller, or I build it in the
> controller and pass it to the thing that will do the work, e.g., a mailer or
> other notifier.
>
> One reason I wouldn't put notification code in an observer is that it will
> fire no matter how you create the model: via the normal flow through the
> Rails stack, in script/console, etc. I usually only want the notification if
> the work is being done through the web app, not script/console.
>
> Food for thought.
>
> Regards,
> Craig
>
> --
> Craig Demyanovich
> Mutually Human Softwarehttp://mutuallyhuman.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
-~----------~----~----~----~------~----~------~--~---