has_state_machine 0.6.0 → 0.6.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d4ecde120f4c419dfe63154f2e61cbb8459a77aedf0b45cc169a3eeac3bcb29
|
|
4
|
+
data.tar.gz: df52aa5a5a23abd0d230281e3d124eacbd56e9bbb17cc094a202a02a208fb732
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c2e58ee081bdbd77e5b9b04adfc8eff0ff94f2bd50c63ed06317be69ae1ff18f28eb32bb149629f06ab41f285c7a4fa4e18788d7a8140b1d91372d3cc3ce8c1
|
|
7
|
+
data.tar.gz: f4aefba6c6484abf2dfb0f79a390ca80c8e686637accd18869f3c0991b74496f38bbbe65b47958213ebf12cc48079d3b01ba373a0f9bff16fbe03c11f64a357e
|
|
@@ -20,11 +20,6 @@ module HasStateMachine
|
|
|
20
20
|
# transactional? - Determines whether or not the transition should happen with a transactional block.
|
|
21
21
|
delegate :possible_transitions, :transactional?, :state, to: "self.class"
|
|
22
22
|
|
|
23
|
-
##
|
|
24
|
-
# Add errors to the ActiveRecord object rather than the HasStateMachine::State
|
|
25
|
-
# class.
|
|
26
|
-
delegate :errors, to: :object
|
|
27
|
-
|
|
28
23
|
##
|
|
29
24
|
# Initializes the HasStateMachine::State instance.
|
|
30
25
|
#
|
|
@@ -114,7 +114,12 @@ module HasStateMachine
|
|
|
114
114
|
def state_instance_validations
|
|
115
115
|
return unless state_class.present?
|
|
116
116
|
|
|
117
|
-
public_send(state_attribute.to_s)
|
|
117
|
+
state_instance = public_send(state_attribute.to_s)
|
|
118
|
+
return if state_instance.valid?
|
|
119
|
+
|
|
120
|
+
state_instance.errors.each do |error|
|
|
121
|
+
errors.add(error.attribute, error.type)
|
|
122
|
+
end
|
|
118
123
|
end
|
|
119
124
|
end
|
|
120
125
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: has_state_machine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamin Hargett
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2024-
|
|
12
|
+
date: 2024-10-09 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|