Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Invalid: dirty AR attributes should be retained if save fails

#930

When saving a record, AR (via the Dirty module) will clear all dirty attributes regardless of the result of the save operation. It would make more sense if these attributes were only cleared upon a successful save. This way, if a save operation fails any helper functions can still tell if a value is dirty after Rails falls back through to the edit/create page.

Here's an example using the console


>> p = Project.new
=> #<Project:0x4735d6c>
>> p.changed
=> []
>> p.id = 1
=> 1
>> p.changed
=> ["id"]
>> p.save
=> false
>> p.changed
=> []

Reported by chrisbloom7 · August 29th, 2008 @ 12:58 AM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. chrisbloom7
    chrisbloom7
    • Title changed from dirty AR attributes should be retained if save fails to Invalid: dirty AR attributes should be retained if save fails
    • Tag changed from activerecord, dirty to invalid

    Never mind, I see in the latest revision this is done

    August 29th, 2008 @ 01:04 AM

  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to invalid
    • Tag cleared.

    August 29th, 2008 @ 01:39 AM