Forum: Ruby on Rails Acessing new field values in validate_on_update

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jon (Guest)
on 2007-06-09 00:28
(Received via mailing list)

How to access to old field values in validate_on_update method? I need
to see if there is changed field's value and if it is so, rise an

Thank you!
Steve R. (Guest)
on 2007-06-11 19:56
I haven't tested this but you could try using Model.find() to get the
version of the object from the database which will as yet be unmodified
by the save. Then compare the fields with the (unsaved) version to see
if changes have been made.

Try it, if it doesnt work I'll suggest something else.

This topic is locked and can not be replied to.