Skip to content

Commit

Permalink
Merge pull request #514 from gocardless/fix-reloading-cache
Browse files Browse the repository at this point in the history
Fix reloading state machine caches
  • Loading branch information
stephenbinns committed Aug 2, 2023
2 parents 455a21d + 5701e31 commit 3c70691
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ Metrics/CyclomaticComplexity:

Metrics/PerceivedComplexity:
Max: 11

Gemspec/DevelopmentDependencies:
Enabled: false
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v10.2.3 2nd Aug 2023

### Changed
- Fixed calls to reloading internal cache is the state_machine was made private / protected

## v10.2.2 21st April 2023

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/statesman/generator_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def model_file_name
end

def migration_class_name
klass.gsub(/::/, "").pluralize
klass.gsub("::", "").pluralize
end

def next_migration_number
Expand Down
2 changes: 1 addition & 1 deletion lib/statesman/adapters/active_record_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def included(base)
define_method(:reload) do |*a|
instance = super(*a)
if instance.respond_to?(:state_machine, true)
instance.state_machine.reset
instance.send(:state_machine).reset
end
instance
end
Expand Down
2 changes: 1 addition & 1 deletion lib/statesman/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Statesman
VERSION = "10.2.2"
VERSION = "10.2.3"
end

0 comments on commit 3c70691

Please sign in to comment.