state_machines 0.304.0 → 0.305.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 338ccdcb73c4d48a79f2c315c7d4d75a7c536cc14e14f317f3ae143714898d8c
4
- data.tar.gz: a69ab4c2ed3017be001800afd17ab3f5846487f2fb72a98ce072a361b43e1e31
3
+ metadata.gz: '0786cd064b1c8a4d4059cf25f0626596722957a07e14b49b8410ee3e89004339'
4
+ data.tar.gz: b767aa9e33559e58d2c1f396d0b37eabf7eda95f5c9a230af4994785a4316fa2
5
5
  SHA512:
6
- metadata.gz: 89ed8906794be85e5a5dd93f157c486e4390196ff8413df790705f684ccf16fb59007445c74e44ad73808303a52286f31d1e4cbf6b7580daa346f6c30b3e9cf9
7
- data.tar.gz: eb1e74b5b5509eda7ac188b8a7dc46b102084befb79623fc5656c8c5d6b715faf783af9e986d7eb551216c0f05589142637670da4cb9c4f94f1f1adcb4e4e381
6
+ metadata.gz: 8b2d9d7a22a0831c1d5db45efcc695b759dd2a50cf3c98ac06bcabacb32b3730405d2113c2c3a0aedfb832c17fa330ceeae77a39fa13977cdbb4eb913204b76a
7
+ data.tar.gz: 748b596b642049249be0e6a3aa13ad160becec9d1ea72b962bc83ffc300d91a287cff5aa20f0eee2cbfec961097900da4e0fe620e97db529b58dbacff4e61aff
@@ -261,6 +261,22 @@ module StateMachines
261
261
  @persisted = true
262
262
  end
263
263
 
264
+ # Whether this transition's state change is in place: written by {#persist}
265
+ # and not undone since by {#rollback} (or {#reset}).
266
+ #
267
+ # A transition that is refused never stays persisted: a halting before
268
+ # callback stops it ahead of the write, and a failed or raising action
269
+ # rolls it back. Once the action has succeeded nothing rolls it back, so
270
+ # it stays persisted whatever the after phase does (an after callback
271
+ # halting, an around callback halting or raising after its yield). A
272
+ # successful preview (e.g. ActiveRecord's +valid?+) leaves it persisted
273
+ # for the full run that completes it.
274
+ #
275
+ # @return [Boolean]
276
+ def persisted?
277
+ @persisted == true
278
+ end
279
+
264
280
  # Rolls back changes made to the object's state via this transition. This
265
281
  # will revert the state back to the +from+ value.
266
282
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StateMachines
4
- VERSION = '0.304.0'
4
+ VERSION = '0.305.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.304.0
4
+ version: 0.305.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih