statesman 10.2.0 → 10.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f18f4e346afec7b89e6057602992d3d69f73f7c18f99d88bb3604d34724f9b0
4
- data.tar.gz: 9888c2c3bc47bb78a52f2b086d9bc3729ddefec9ab776663ebf04ec9118c4d05
3
+ metadata.gz: 84f52a986a8c32bd6f42d6e450da1b26b8608cf4dc7434a163ee602d84425a36
4
+ data.tar.gz: 8aaf748af7917715006dd2bd8b7946656ecbaa3cfd9dd7df9bd776da06f5ce41
5
5
  SHA512:
6
- metadata.gz: 50cdb42aa87bf9ab25e4f5a0de6f4f52647866453d9298811351ac16fdec88e7ff7b210948f756b9af59983e56cc5ca842232ae240be54f1a9e37185958eee9d
7
- data.tar.gz: c9835aa4537d9e8adab3a75d6f63b020eaac4d4ec5aa15a8be4a4f2a6f41a869a54b5398862b23b84929cf219aff6b86eac00af3fd4a86b3e4c0ff3a6c84bae7
6
+ metadata.gz: dc43e626d95b225a002c423092dc0906aa93365b028f8d9fef20a19c4657bef8761c430321db3046dece32d5b9ed3f8fac667a502ba13bfb9f5df8460d9cfd5d
7
+ data.tar.gz: 7aa34ddc4e22e611d942db5b6c9751496a203bcb678b5a89ff8772c251515edfa27a4bca92f2c999d499b63105624464dd0e7d42dba5dcb8670d6bafcc1bd517
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v10.2.1 3rd April 2023
2
+
3
+ ### Changed
4
+ - Fixed an edge case where `adapter.reset` were failing if the cache is empty
5
+
1
6
  ## v10.2.0 3rd April 2023
2
7
 
3
8
  ### Changed
@@ -52,7 +52,7 @@ module Statesman
52
52
 
53
53
  raise
54
54
  ensure
55
- remove_instance_variable(:@last_transition)
55
+ reset
56
56
  end
57
57
 
58
58
  def history(force_reload: false)
@@ -76,7 +76,8 @@ module Statesman
76
76
  end
77
77
 
78
78
  def reset
79
- remove_instance_variable(:@last_transition)
79
+ remove_instance_variable(:@last_transition) \
80
+ if instance_variable_defined?(:@last_transition)
80
81
  end
81
82
 
82
83
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Statesman
4
- VERSION = "10.2.0"
4
+ VERSION = "10.2.1"
5
5
  end
@@ -388,6 +388,12 @@ describe Statesman::Adapters::ActiveRecord, active_record: true do
388
388
  end
389
389
  end
390
390
 
391
+ describe "#reset" do
392
+ it "works with empty cache" do
393
+ expect { model.state_machine.reset }.to_not raise_error
394
+ end
395
+ end
396
+
391
397
  it "resets last with #reload" do
392
398
  model.save!
393
399
  ActiveRecord::Base.transaction do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statesman
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.2.0
4
+ version: 10.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless