Identifying changes to activerecord tables from form input

Hey, wonderful Rails people!

If I have a person record, and associated (has many) address records,
is there any easy way that I can identify which fields have been
changed via form, instead of updating the db in a standard sense.

Specifically, I’m trying to create “change request” records for each
field that’s modified via a form which has all the person fields, as
well as all the associated address fields for the standard (home,
office) address types. However, instead of actually doing the update
through activerecord, I’m just trying to trap the change requests.

If, for instance, on the “Edit” screen I change the spelling of my
first name and my home address’s city, I’d like it to create two
“change” records, but not touch the person or address records that are
out there.

So far I’m hitting a wall. Has anyone else tried to do something
similar and come up with more luck?

Thanks!
–Scott

I’m using acts_as_audited which sets a @changed_attributes attribute on
the
models when something changes, but not necessarily saving it. Perhaps
this
could also be of use to you.

On Nov 29, 2007 9:45 AM, Scott [email protected] wrote:

office) address types. However, instead of actually doing the update
Thanks!
–Scott

–
Ryan B.

This looks like it’ll work perfectly. Thank you so much!

–Scott