Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/migrate/20230301024452_encrypt_api_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def change

def encrypt_api_keys
connection.select_all("SELECT id, api_key FROM users").each do |user|
encrypted_api_key = ActiveRecord::Encryption.encrypt(user["api_key"])
encrypted_api_key = ActiveRecord::Encryption.encryptor.encrypt(user["api_key"])
connection.update("UPDATE users SET api_key = #{connection.quote(encrypted_api_key)} WHERE id = #{user['id']}")
end
end
Expand Down