Hi !
There's after_find and after_initialize you can use to copy the
values. If you have only one or two fields, just override the field's
setter methods:
class X < AR:Base
def attribute=(new_value)
old_value ||= read_attribute(:attribute)
write_attribute(:attribute, new_value)
end
end
Untested, and I'm not even sure write|read_attribute are the right
method names. You get the gist, though.
Bye !
François
2005/11/27, CSN <cool_screen_name90001@yahoo.com>:> I want to expire caches if a certain field of an item changes. How can I
compare the item field's
> old value to its new value (in the create, or after_save, etc. method)?
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails