>
> > While technically you're right
>
> Way to get me onside ;-)
>
I'm a part-time developer and part-time sleazy politician ;-) "I completely
agree with you 100%, however..." (notice no "but"). j/k
> Let's split the difference...
>
Completely agree with the solution (and it's what I had in
On 3 March 2010 14:04, Andy Jeffries wrote:
> While technically you're right
Way to get me onside ;-)
> we don't know the full facts in what he's trying to do.
Agreed - the "oh, but I didn't tell you about this condition" syndrome.
> :-)
Let's split the difference... create a method on the us
>
> On 3 March 2010 13:16, Andy Jeffries 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
On 3 March 2010 13:16, Andy Jeffries 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
:-/
--
You received this message because you are
>
> If you look at the source code for update_attributes, you'll see it
> does a "save" in the method, so once it's finished, the are no changed
> fields (because the record has already been updated).
>
> You need a callback filter to run in your User model; and
> "before_save" seems sensible to me
On 3 March 2010 11:51, Tom Mac wrote:
> Hi Conrad
>
> Thanks for your reply. But this is not working for
> update_attributes. What I tried is in update action
>
> @user = User.find(params[:id])
> if @user.update_attributes(params[:user])
> send_mail if @user.changed? #But this is always retu
Hi Conrad
Thanks for your reply. But this is not working for
update_attributes. What I tried is in update action
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
send_mail if @user.changed? #But this is always returns false Not
working
-
else
end
7 matches
Mail list logo