ruby on rails - attr_encrypted and postgresql, does it work? -
des attr_encryptor (or attr_encrypted) works postgresql ? datas not saved, when wrote
@object.encrypted_value
i have never saved... or maybe doing wrong ?
my model looks :
model user < activerecord::base attr_accessible :name, :email attr_encrypted :email, :key => "asecretkey" end
in ddb, have user(name, encrypted_email, encrypted_email_iv, encrypted_email_salt) character varying(255) each.
and form c.email (and not c.encrypted_email, right ?)
what model like? if have @object.my_value = 'thing'
model should like
class myobject attr_encrypted :my_value, :key => 'a secret key' end
don't forget call #save
on object after assigning value. should able encrypted payload @object.encrypted_my_value
if want. db need string field called encrypted_my_value.
Comments
Post a Comment