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.

Calling reload on model should clear attribute changes

#231

Currently, calling reload on a model does not clear the attribute changes:

product.name = "foo"
product.changed? # => true
product.reload
product.changed? # => true

This patch fixes this problem by clearing the changed attributes after a reload. Tests are included.

Reported by Ryan Bates · May 21st, 2008 @ 04:41 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [262d23d763c05bbe5f433a99cb9f02e48a8cdd4a]) ActiveRecord::Base#reload should clear dirty attributes. [#231 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    May 21st, 2008 @ 08:43 PM

  2. Pratik
    Pratik

    Committed with a minor change.

    Thanks.

    May 21st, 2008 @ 08:45 PM