I had a question about migrating a field from attr_encrypted to lockbox, but wasn’t sure the best place to ask it.
We have a field that is defined as such:
attr_encrypted :unencrypted_request_xml, :attribute => "request_xml"
The database column is named request_xml.
When migrating to lockbox, I would like the new attribute name to be request_xml and the column name to be request_xml_ciphertext.
If there’s a way to do this with lockbox, I haven’t found it. I’ve created the request_xml_ciphertext column and have tried the following for defining the attribute:
Hi,
I had a question about migrating a field from attr_encrypted to lockbox, but wasn’t sure the best place to ask it.
We have a field that is defined as such:
attr_encrypted :unencrypted_request_xml, :attribute => "request_xml"
The database column is named
request_xml
.When migrating to lockbox, I would like the new attribute name to be
request_xml
and the column name to berequest_xml_ciphertext
.If there’s a way to do this with lockbox, I haven’t found it. I’ve created the
request_xml_ciphertext
column and have tried the following for defining the attribute:encrypts :unencrypted_request_xml, encrypted_attribute: "request_xml", migrating: true
encrypts :unencrypted_request_xml, encrypted_attribute: "request_xml_ciphertext", migrating: true
Any suggestions on how to make this work?