0

I have an existing project that I am now trying to update to use the attr-encrypted gem to encrypt some of my existing table columns.

Everything works as expected IF I update the names of the table attributes that I want encrypted to start with 'encrypted_'.

However, I am trying to avoid modifying my tables at all. Is that possible using attr-encrypted? And if so, how would I reference the encrypted/decrypted versions of the column data?

So for example, I have a Users table with a phone_number attribute. I want to encrypt the phone_number data without having to rename it to encrypted_phone_number in order for the attr_encrypted gem to work.

Thanks,

Hawkeye001
  • 791
  • 2
  • 11
  • 25

1 Answers1

0

I don't think its possible, as attr-encrypted gem needs to differentiate between these fields (before encrypted vs after encrypted) and it tries to hook into the active_record hooks in order to encrypt the fields.

Dharam Gollapudi
  • 6,328
  • 2
  • 34
  • 42