Skip to content

Commit

Permalink
update statesman
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamfall committed Nov 6, 2023
1 parent 7b86842 commit cfeb71b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ gem 'kaminari'
gem 'wicked', '~> 1.1'

# Statemachine
gem 'statesman', '3.5.0'
gem 'statesman', '~> 11.0'

# Form & Data helpers
gem 'simple_form', '~> 5.0'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ GEM
activesupport (>= 5.2)
sprockets (>= 3.0.0)
ssrf_filter (1.1.2)
statesman (3.5.0)
statesman (11.0.0)
stringio (3.0.8)
temple (0.8.2)
thor (1.3.0)
Expand Down Expand Up @@ -858,7 +858,7 @@ DEPENDENCIES
slim-rails (~> 3.2.0)
sprockets (~> 3.7.2)
sprockets-rails (>= 2.0.0)
statesman (= 3.5.0)
statesman (~> 11.0)
timecop
turnip (~> 4.4.0)
uglifier (>= 2.7.2)
Expand Down
5 changes: 4 additions & 1 deletion app/models/form_answer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
require_relative '../../forms/award_years/v2024/qae_forms'

class FormAnswer < ApplicationRecord
include Statesman::Adapters::ActiveRecordQueries
include Statesman::Adapters::ActiveRecordQueries[
initial_state: :eligibility_in_progress,
transition_class: FormAnswerTransition
]
include PgSearch::Model
extend Enumerize
include FormAnswerStatesHelper
Expand Down
2 changes: 1 addition & 1 deletion app/models/form_answer_transition.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class FormAnswerTransition < ApplicationRecord
include Statesman::Adapters::ActiveRecordTransition

belongs_to :form_answer, inverse_of: :form_answer_transitions
belongs_to :form_answer, optional: true, inverse_of: :form_answer_transitions

def transitable
t_type = metadata["transitable_type"]
Expand Down

0 comments on commit cfeb71b

Please sign in to comment.