Skip to content

Commit

Permalink
Change in_state check
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl committed Oct 25, 2024
1 parent 1096bd5 commit e6e0ad5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/asp/payment_request.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module ASP
class PaymentRequest < ApplicationRecord
class PaymentRequest < ApplicationRecord # rubocop:disable Metrics/ClassLength
TRANSITION_CLASS = ASP::PaymentRequestTransition
STATE_MACHINE_CLASS = ASP::PaymentRequestStateMachine

Expand Down Expand Up @@ -127,7 +127,7 @@ def eligible_for_incomplete_retry?
end

def eligible_for_rejected_or_unpaid_auto_retry?
return false unless in_state?(:rejected) || in_state?(:unpaid)
return false unless in_state?(:rejected, :unpaid)

decorator = ActiveDecorator::Decorator.instance.decorate(self)
message = in_state?(:rejected) ? decorator.rejected_reason : decorator.unpaid_reason
Expand Down

0 comments on commit e6e0ad5

Please sign in to comment.