Set member status to sustainer upon payment
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Introduces a state machine for the payment status as well.

refs #213
This commit is contained in:
2025-05-27 16:39:03 +04:00
parent 463bf34cdf
commit e48132cf5f
10 changed files with 73 additions and 24 deletions

View File

@@ -0,0 +1,6 @@
class UpdatePaymentStatusToPending < ActiveRecord::Migration[8.0]
def change
Donation.where(payment_status: nil).update_all(payment_status: "pending")
Donation.where.not(payment_status: %w[pending processing settled]).update_all(payment_status: "pending")
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_05_17_105755) do
ActiveRecord::Schema[8.0].define(version: 2025_05_27_113805) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false