From b510736a8d10168eba19b6999f832641dadbdea2 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Wed, 3 Sep 2025 03:19:40 +0500 Subject: [PATCH] refactor migration to use SpreePayment model instead of Spree::Payment --- ...250827205335_migrate_cvv_message_to_redirect_auth_url.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/migrate/20250827205335_migrate_cvv_message_to_redirect_auth_url.rb b/db/migrate/20250827205335_migrate_cvv_message_to_redirect_auth_url.rb index 035bc63161..c03ac94c1f 100644 --- a/db/migrate/20250827205335_migrate_cvv_message_to_redirect_auth_url.rb +++ b/db/migrate/20250827205335_migrate_cvv_message_to_redirect_auth_url.rb @@ -1,8 +1,10 @@ # frozen_string_literal: true class MigrateCvvMessageToRedirectAuthUrl < ActiveRecord::Migration[7.1] + class SpreePayment < ActiveRecord::Base; end + def up - records = Spree::Payment.where.not( + records = SpreePayment.where.not( cvv_response_message: nil ).where.not( state: :completed @@ -14,7 +16,7 @@ class MigrateCvvMessageToRedirectAuthUrl < ActiveRecord::Migration[7.1] end def down - records = Spree::Payment.where.not( + records = SpreePayment.where.not( redirect_auth_url: nil ).where.not( state: :completed