Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def show
document_capture_session = DocumentCaptureSession.find_by(
uuid: document_capture_session_uuid,
)
document_capture_session.socure_docv_token = document_response.dig(
document_capture_session.socure_docv_transaction_token = document_response.dig(
:data,
:docvTransactionToken,
)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/socure/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def show
uuid: document_capture_session_uuid,
)

document_capture_session.socure_docv_token = document_response.dig(
document_capture_session.socure_docv_transaction_token = document_response.dig(
:data,
:docvTransactionToken,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenameSocureDocvTokenInDocumentCaptureSession < ActiveRecord::Migration[7.1]
def change
safety_assured { rename_column :document_capture_sessions, :socure_docv_token, :socure_docv_transaction_token }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish StrongMigrations' documentation included more details than just "will cause errors", but based on their "safer approach" guidelines, I do think we'd be safe if we're not currently using this column.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also a rename_column_safely helper from StrongMigrations, which preserves the expressivity while doing it the way they recommend. Based on previous comment, don't know that it's strictly necessary.

end
end
4 changes: 2 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_10_01_193936) do
ActiveRecord::Schema[7.1].define(version: 2024_10_17_153042) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "pg_stat_statements"
Expand Down Expand Up @@ -191,7 +191,7 @@
t.datetime "cancelled_at", precision: nil, comment: "sensitive=false"
t.boolean "ocr_confirmation_pending", default: false, comment: "sensitive=false"
t.string "last_doc_auth_result", comment: "sensitive=false"
t.string "socure_docv_token", comment: "sensitive=false"
t.string "socure_docv_transaction_token", comment: "sensitive=false"
t.index ["result_id"], name: "index_document_capture_sessions_on_result_id"
t.index ["user_id"], name: "index_document_capture_sessions_on_user_id"
t.index ["uuid"], name: "index_document_capture_sessions_on_uuid"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@

it 'puts the docvTransactionToken into the document capture session' do
document_capture_session.reload
expect(document_capture_session.socure_docv_token).to eq(docv_transaction_token)
expect(document_capture_session.socure_docv_transaction_token).
to eq(docv_transaction_token)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@

it 'puts the docvTransactionToken into the document capture session' do
document_capture_session.reload
expect(document_capture_session.socure_docv_token).to eq(docv_transaction_token)
expect(document_capture_session.socure_docv_transaction_token).
to eq(docv_transaction_token)
end
end
end
Expand Down