From 88d589a4e23b664aa9a6820566246cddab6b3712 Mon Sep 17 00:00:00 2001 From: Aleksey Stepanov Date: Wed, 30 Nov 2022 17:43:54 +0400 Subject: [PATCH] [#330] improved naming of states and events --- core/app/lib/uffizzi_core/concerns/models/account.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/app/lib/uffizzi_core/concerns/models/account.rb b/core/app/lib/uffizzi_core/concerns/models/account.rb index 28a14bd6..4e69355f 100644 --- a/core/app/lib/uffizzi_core/concerns/models/account.rb +++ b/core/app/lib/uffizzi_core/concerns/models/account.rb @@ -26,17 +26,17 @@ module UffizziCore::Concerns::Models::Account aasm(:state) do state :trial, initial: true - state :require_card + state :spent_free_limit state :active state :payment_issue state :disabled event :activate do - transitions from: [:payment_issue, :disabled, :require_card, :trial], to: :active + transitions from: [:payment_issue, :disabled, :spent_free_limit, :trial], to: :active end - event :enable_paywall do - transitions from: [:trial], to: :require_card + event :disable_trial do + transitions from: [:trial], to: :spent_free_limit end event :raise_payment_issue, before_success: :update_payment_issue_date do @@ -44,7 +44,7 @@ module UffizziCore::Concerns::Models::Account end event :disable, after: :disable_projects do - transitions from: [:active, :payment_issue, :trial, :require_card], to: :disabled + transitions from: [:active, :payment_issue, :trial, :spent_free_limit], to: :disabled end end