undefined method `blind_index' for User
GT353 opened this issue · 2 comments
I am receiving an Undefined Method Error and NameError: uninitialized constant BlindIndex error when trying to add blind_index to my application. Specifically, when trying to access the rails console or run BlindIndex.backfill(User).
Version Information:
rails 6.0.2.1
ruby "~> 2.7"
lockbox 0.4.8
blind_index 2.1.1
Using attr_encrypted 3.1.0
excerpt from the migration:
def change
add_column :users, :email_bidx, :string
add_index :users, :email_bidx, unique: true, algorithm: :concurrently
end
excerpt from the model:
encrypts :email
blind_index :email
Additional details:
I also receive the following error when trying to create a new user or log-in:
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column users.email does not exist
Hey @GT353, that error message indicates the gem isn't installed. If you're using Spring, try restarting it with bin/spring stop
. Please use Stack Overflow if additional help is needed.