changed_attributes is cleared unconditionally after save (and save!)
attempts:
# Clear changed attributes after they are saved.
def save_with_dirty(*args) #:nodoc:
save_without_dirty(*args)
ensure
changed_attributes.clear
end
I'd expect that to happen only if save succeeds. Which is the rationale?
-- fxn
on 2008-05-12 22:47
on 2008-05-12 23:37
On Mon, May 12, 2008 at 1:46 PM, Xavier Noria <fxn@hashref.com> wrote:
> I'd expect that to happen only if save succeeds. Which is the rationale?
I agree. Do you have a patch?
Best,
jeremy
on 2008-05-13 01:05
On Mon, May 12, 2008 at 11:36 PM, Jeremy Kemper <jeremy@bitsweat.net> wrote: > > changed_attributes.clear > > end > > > > I'd expect that to happen only if save succeeds. Which is the rationale? > > I agree. Do you have a patch? Here we go, all AR tests pass (except for an unrelated failure): http://rails.lighthouseapp.com/projects/8994/ticke... -- fxn
on 2008-05-13 02:07
On Mon, May 12, 2008 at 4:05 PM, Xavier Noria <fxn@hashref.com> wrote: > > > def save_with_dirty(*args) #:nodoc: > > http://rails.lighthouseapp.com/projects/8994/ticke... Thanks Xavier! jeremy