Attr_encrypted not save to database

Ruby 1.9.2p180, Rails 3.0.8, attr_encrypted 1.2.0

So, in my model, I have the following:

attr_encryptor :email, :key => "awesome_key"

And in the database, I have a text column called "encrypted_email".

In the console, everything works in memory. The encrypted_email attribute is updated with the encrypted version and all. But when I go to save it, nothing happens.

While communicating with him, I found that the model change hash does not reflect the encrypted_email change, even if I try to set the value manually.

Am I doing something wrong here or broken? Does anyone know how things are added to a change hash? Is there any method call or something that I could add the setter methods that attr_encrypted generates so that the changes display in the hash?

Thank!

+3
source share
1 answer

The community seems to have fixed the bug. Back when I tried to make it work, I was just in the wrong place at the wrong time, apparently :-)

0
source

All Articles