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 +4 -4
- data/lib/state_machines/transition.rb +16 -0
- data/lib/state_machines/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0786cd064b1c8a4d4059cf25f0626596722957a07e14b49b8410ee3e89004339'
|
|
4
|
+
data.tar.gz: b767aa9e33559e58d2c1f396d0b37eabf7eda95f5c9a230af4994785a4316fa2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
#
|