http://api.rubyonrails.com/classes/ActiveRecord/Callbacks.html
On 3/17/06, Denise Eatherly <denise@kurisudesign.com>
wrote:>
> Hi,
>
> I''m looking at ways to encrypt email addresses rather than storing
> them directly in the database.
>
> There are several ways that it could be done. I could make an
> Encrypter class and use before_update, etc. Or I could set up an
> updatable VIEW in mySql. (I guess triggers might be another
> possibility.)
>
> However, what I would really LIKE to do is use the handy AES_ENCRYPT
> and AES_DECRYPT functions in mySql. If I were doing this with
> straight sql, I would just use
> INSERT INTO myTable VALUES( null, ''user name'',
AES_ENCRYPT
> (''user_email'' , ''password'' ).
>
> Since ActiveRecord handles all this for me, it is not clear if I can
> override the insert, update and select statements for a table. It
> may not be a very good idea, but I''d like more information before
> giving up on it.
>
> Thanks,
> Denise
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060316/183e46e7/attachment-0001.html