>
> On 3 March 2010 13:16, Andy Jeffries <[email protected]> wrote:
> > if @user.changed?
> >   @user.save
> >   send_mail
> > end
>
> ... and repeat that in every method that makes any updates to your user...
>
> Whatever works for you, though... it's your code after all.
>
> Be DRY
> :-/
>

While technically you're right (and therefore it may make more sense to move
it to the model - @user.update_attributes_and_notify), it seems (from
reading between the OP's lines) like there are a number of places where he'd
want to update the user himself (and not send an email) and only have it
send the email from a particular place/action.

I completely agree about DRYness, but I was just offering an alternative
solution as we don't know the full facts in what he's trying to do.

:-)

Cheers,


Andy

-- 
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