I have a class in which the data is encrypted and stored for all fields. Whenever the record is loaded from database, the data should be decrypted. If there was a after_find callback, we could have done the decryption in that, but after_find doesnot exist. So how can we implement after_find or is there any other callback which can be useful. Regards, Pankaj
Frederick Cheung
2009-Jun-16 08:41 UTC
Re: Active record callback after_find doesnot exist
On Jun 16, 9:37 am, pankaj <pankajbhage...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a class in which the data is encrypted and stored for all > fields. > Whenever the record is loaded from database, the data should be > decrypted. > If there was a after_find callback, we could have done the decryption > in that, but after_find doesnot exist. > So how can we implement after_find or is there any other callback > which can be useful. > Regards, > PankajAccording to http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html after_find does exists. Fred