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: 9f5dce90790fc426f0030f3052f7a09aecc373c5cf71185e4d7a2b22280e834d
4
- data.tar.gz: e41c13e77237380c39f420797f2f151a3e615390c3966ac196432f1805370357
3
+ metadata.gz: 7d4ecde120f4c419dfe63154f2e61cbb8459a77aedf0b45cc169a3eeac3bcb29
4
+ data.tar.gz: df52aa5a5a23abd0d230281e3d124eacbd56e9bbb17cc094a202a02a208fb732
5
5
  SHA512:
6
- metadata.gz: 78b889ab38cc3aa0bbf1c7c6f43918894a4afab27be0a4c70ac223b58d8d71521154988ba23c4596110c760295dacdc87005fe67b9709edb894c5c7c64f822ba
7
- data.tar.gz: 2e5b88c5c7866ce435593a05d9117fe69839e3f01cba591744466ac91cbcb6e26ac700bea31282e3a6c12d04db3c6ab025a7b2a8bf62ced6f91e96ae17babd05
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).valid?
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HasStateMachine
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
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.0
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-07-19 00:00:00.000000000 Z
12
+ date: 2024-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails