Add Plaid migration constant alias (#1235)

Restore the original migration constant name as an alias so old references still resolve during production boot and migration loading. Add a regression test covering the legacy alias.
This commit is contained in:
Juan José Mata
2026-03-21 01:03:19 +01:00
committed by GitHub
parent 445206a02f
commit 8bc4cae728
2 changed files with 14 additions and 0 deletions

View File

@@ -26,3 +26,7 @@ class ScopePlaidItemUniqueness < ActiveRecord::Migration[7.2]
add_index :plaid_accounts, :plaid_id, name: "index_plaid_accounts_on_plaid_id", unique: true
end
end
# Backwards-compatible alias for environments that may still reference the
# original migration constant derived from the old filename.
ScopePlaidAccountUniquenessToItem = ScopePlaidItemUniqueness unless defined?(ScopePlaidAccountUniquenessToItem)

View File

@@ -0,0 +1,10 @@
# frozen_string_literal: true
require "test_helper"
require Rails.root.join("db/migrate/20260219200001_scope_plaid_item_uniqueness")
class ScopePlaidItemUniquenessMigrationTest < ActiveSupport::TestCase
test "defines the legacy migration constant alias" do
assert_equal ScopePlaidItemUniqueness, ScopePlaidAccountUniquenessToItem
end
end