attr_encrypted not saving to database
Ruby 1.9.2p180, Rails 3.0.8, attr_encrypted 1.2.0
So, in my model I开发者_JAVA百科 have the following:
attr_encryptor :email, :key => "awesome_key"
And in the database I have a text column named "encrypted_email".
In the console, everything works in memory. The encrypted_email attribute is updated with the encrypted version and everything. But when I go to save it, nothing happens.
While messing around with it I discovered that the model's changes hash does not reflect the changes to encrypted_email, even if I try to set the value manually.
Am I doing something wrong here or is attr_encrypted broken? Does anyone know how things get added to the changes hash? Is there some method call or something that I could add the setter methods that attr_encrypted generates so that changes show up in the hash?
Thanks!
It looks like the community fixed the bug. Back when I was trying to make it work I just in the wrong place at the wrong time apparently :-)
精彩评论