state_machinable 3.0.0 → 3.1.0.pre

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
  SHA1:
3
- metadata.gz: 0bbfb3047a99c53d23fc4316528d79f8ef1176b6
4
- data.tar.gz: 9daef6ebebb7bcd0a94e9d81b616b63543354980
3
+ metadata.gz: 1776720bfe0cfb415e213242f18e3869325f2082
4
+ data.tar.gz: 22946208de65f834093a3dcfab2f09874cca45d4
5
5
  SHA512:
6
- metadata.gz: bb01c4255e1002001a65ed3d2dbf7d2f3772602de26561f57637ced0e36fd62945ee4da2f9bd88845ad62fb2ad044a634033db311ead6496d7c36b91ef78de5e
7
- data.tar.gz: c4a858e3af2c71bac02b2cbf440776c41bf5756e72e0199d07ba9e2a4b6aaf3cc899577a69217336a0bfab5c00641a3f14ec91d9707f499084c4e5bf6fb55ee1
6
+ metadata.gz: 7d26e8d7fea223d2e8689b3b250c81ed4d9089fd85cb2f8d395ba282f31075b86075b0b48a960c4b44eeae413b75d034ef9eb3e073ebda60580658c8047d876a
7
+ data.tar.gz: 7bbd911066d2da2424c50c4a0e020ff68a8a19c9743927acae7f31b8c632ef6ba93ac01d4a3abf1b51bddebd8c23ac42ed6bf036536c3ceb5b30cc21db10f9c7
@@ -23,9 +23,15 @@ module StateMachinable
23
23
  end
24
24
 
25
25
  after_transition do |obj, transition|
26
- obj.update(:current_state => transition.to_state)
27
-
28
26
  state_class = obj.state_machine.class.state_class(transition.to_state)
27
+ update_hash = {}
28
+
29
+ if state_class.present? && state_class.respond_to?(:pre_enter_updates_to_do)
30
+ update_hash.merge!(state_class.pre_enter_updates_to_do(obj))
31
+ end
32
+
33
+ obj.update(update_hash.merge!(:current_state => transition.to_state))
34
+
29
35
  if state_class.present? && state_class.respond_to?(:enter)
30
36
  state_class.enter(obj)
31
37
  end
@@ -1,3 +1,3 @@
1
1
  module StateMachinable
2
- VERSION = "3.0.0"
2
+ VERSION = "3.1.0.pre"
3
3
  end
@@ -30,6 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "bundler", "~> 1.14"
31
31
  spec.add_development_dependency "rake", "~> 10.0"
32
32
  spec.add_development_dependency "rspec", "~> 3.0"
33
+ spec.add_development_dependency "pry"
34
+ spec.add_development_dependency "activerecord", ">= 4", "< 6"
35
+ spec.add_development_dependency "sqlite3", "~> 1.3"
33
36
  spec.add_dependency "statesman", "> 2.0"
34
37
  spec.add_dependency "activesupport", ">= 4", "< 6"
35
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machinable
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santiago Herrera
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,54 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activerecord
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '4'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '6'
79
+ type: :development
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '4'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '6'
89
+ - !ruby/object:Gem::Dependency
90
+ name: sqlite3
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '1.3'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '1.3'
55
103
  - !ruby/object:Gem::Dependency
56
104
  name: statesman
57
105
  requirement: !ruby/object:Gem::Requirement
@@ -125,9 +173,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
173
  version: '0'
126
174
  required_rubygems_version: !ruby/object:Gem::Requirement
127
175
  requirements:
128
- - - ">="
176
+ - - ">"
129
177
  - !ruby/object:Gem::Version
130
- version: '0'
178
+ version: 1.3.1
131
179
  requirements: []
132
180
  rubyforge_project:
133
181
  rubygems_version: 2.6.8