Skip to content

Commit

Permalink
[#330] improved naming of states and events
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey Stepanov committed Nov 30, 2022
1 parent 89d1901 commit d1c1b57
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/app/lib/uffizzi_core/concerns/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,25 @@ 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
transitions from: [:active, :disabled], to: :payment_issue
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

Expand Down

0 comments on commit d1c1b57

Please sign in to comment.