# Active record callback after\_find doesnot exist

**URL:** <https://www.ruby-forum.com/t/active-record-callback-after-find-doesnot-exist/170340>\
**Category:** Rails\
**Created:** [June 16, 2009, 10:39am UTC](https://www.ruby-forum.com/t/active-record-callback-after-find-doesnot-exist/170340 "2009-06-16T10:39:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Post date:** [June 16, 2009, 10:39am UTC](https://www.ruby-forum.com/t/active-record-callback-after-find-doesnot-exist/170340/1 "2009-06-16T10:39:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pankaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Post date:** [June 16, 2009, 10:42am UTC](https://www.ruby-forum.com/t/active-record-callback-after-find-doesnot-exist/170340/2 "2009-06-16T10:42:44Z")

</div>

On Jun 16, 9:37 am, pankaj [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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,  
> Pankaj

According to

> **[ActiveRecord::Callbacks](https://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html)**
>
> Active Record Callbacks Callbacks are hooks into the life cycle of an Active Record object that allow you to trigger logic before or after a change in the object state.

after\_find does exists.

Fred
