When I drop the plain text column, I am no longer able to access the email field by using User.last.email, it says
undefined method `email' for #<User:0x0000000125f46340>
I would expect to be able to access this field.
This is how my user model looks like:
has_encrypted :email, migrating: true
blind_index :email, migrating: true
# removing this does not change anything, email is still not acessible
self.ignored_columns = ["email"]
The initial migration:
class AddEncryptionToPiiFields < ActiveRecord::Migration[6.0]
def change
# users encrypted fields
add_column :users, :email_ciphertext, :text
# users blind columns and indexes
add_column :users, :email_bidx, :string
add_index :users, :email_bidx, unique: true
end
end
After the first migration I ran Lockbox.migrate(User). Once that has completed, I drop the columns with this following migration:
class DropNonEncryptedFields < ActiveRecord::Migration[6.0]
def change
remove_column :users, :email
end
end
What am I missing? Why I am not able to access the email field anymore?
I have lockbox v1.3.3 / blind index installed (have to use this version, can't upgrade at the moment).
I followed these steps:
When I drop the plain text column, I am no longer able to access the email field by using
User.last.email
, it saysI would expect to be able to access this field.
This is how my user model looks like:
The initial migration:
After the first migration I ran
Lockbox.migrate(User)
. Once that has completed, I drop the columns with this following migration:What am I missing? Why I am not able to access the
email
field anymore?The DB seems to have all the fields in place.