aasm 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/aasm.gemspec +1 -1
- data/lib/aasm/base.rb +2 -2
- data/lib/aasm/version.rb +1 -1
- data/spec/models/sub_classing.rb +3 -0
- data/spec/unit/state_transition_spec.rb +7 -1
- metadata +23 -21
data/CHANGELOG.md
CHANGED
data/aasm.gemspec
CHANGED
@@ -5,7 +5,7 @@ require "aasm/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "aasm"
|
7
7
|
s.version = AASM::VERSION
|
8
|
-
s.authors = ["Scott Barron", "Scott Petersen", "Travis Tilley", "Thorsten
|
8
|
+
s.authors = ["Scott Barron", "Scott Petersen", "Travis Tilley", "Thorsten Boettger"]
|
9
9
|
s.email = %q{scott@elitists.net, ttilley@gmail.com}
|
10
10
|
s.homepage = %q{http://rubyist.github.com/aasm/}
|
11
11
|
s.summary = %q{State machine mixin for Ruby objects}
|
data/lib/aasm/base.rb
CHANGED
@@ -7,13 +7,13 @@ module AASM
|
|
7
7
|
|
8
8
|
if options.key?(:whiny_transitions)
|
9
9
|
sm.config.whiny_transitions = options[:whiny_transitions]
|
10
|
-
|
10
|
+
elsif sm.config.whiny_transitions.nil?
|
11
11
|
sm.config.whiny_transitions = true # this is the default, so let's cry
|
12
12
|
end
|
13
13
|
|
14
14
|
if options.key?(:skip_validation_on_save)
|
15
15
|
sm.config.skip_validation_on_save = options[:skip_validation_on_save]
|
16
|
-
|
16
|
+
elsif sm.config.skip_validation_on_save.nil?
|
17
17
|
sm.config.skip_validation_on_save = false # this is the default, so don't store any new state if the model is invalid
|
18
18
|
end
|
19
19
|
end
|
data/lib/aasm/version.rb
CHANGED
@@ -8,12 +8,18 @@ describe 'transitions' do
|
|
8
8
|
process.should be_sleeping
|
9
9
|
end
|
10
10
|
|
11
|
-
it 'should not raise an exception when whiny' do
|
11
|
+
it 'should not raise an exception when not whiny' do
|
12
12
|
silencer = Silencer.new
|
13
13
|
silencer.smile!.should be_false
|
14
14
|
silencer.should be_silent
|
15
15
|
end
|
16
16
|
|
17
|
+
it 'should not raise an exception when superclass not whiny' do
|
18
|
+
sub = SubClassing.new
|
19
|
+
sub.smile!.should be_false
|
20
|
+
sub.should be_silent
|
21
|
+
end
|
22
|
+
|
17
23
|
end
|
18
24
|
|
19
25
|
describe AASM::SupportingClasses::StateTransition do
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Scott Barron
|
9
9
|
- Scott Petersen
|
10
10
|
- Travis Tilley
|
11
|
-
- Thorsten
|
11
|
+
- Thorsten Boettger
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-02
|
15
|
+
date: 2012-04-02 00:00:00.000000000Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activerecord
|
19
|
-
requirement: &
|
19
|
+
requirement: &70112209965860 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '0'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70112209965860
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
|
-
requirement: &
|
30
|
+
requirement: &70112209965440 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,10 +35,10 @@ dependencies:
|
|
35
35
|
version: '0'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *70112209965440
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: sdoc
|
41
|
-
requirement: &
|
41
|
+
requirement: &70112209965020 !ruby/object:Gem::Requirement
|
42
42
|
none: false
|
43
43
|
requirements:
|
44
44
|
- - ! '>='
|
@@ -46,10 +46,10 @@ dependencies:
|
|
46
46
|
version: '0'
|
47
47
|
type: :development
|
48
48
|
prerelease: false
|
49
|
-
version_requirements: *
|
49
|
+
version_requirements: *70112209965020
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec
|
52
|
-
requirement: &
|
52
|
+
requirement: &70112209964520 !ruby/object:Gem::Requirement
|
53
53
|
none: false
|
54
54
|
requirements:
|
55
55
|
- - ~>
|
@@ -57,10 +57,10 @@ dependencies:
|
|
57
57
|
version: '2.0'
|
58
58
|
type: :development
|
59
59
|
prerelease: false
|
60
|
-
version_requirements: *
|
60
|
+
version_requirements: *70112209964520
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rr
|
63
|
-
requirement: &
|
63
|
+
requirement: &70112209964100 !ruby/object:Gem::Requirement
|
64
64
|
none: false
|
65
65
|
requirements:
|
66
66
|
- - ! '>='
|
@@ -68,10 +68,10 @@ dependencies:
|
|
68
68
|
version: '0'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
|
-
version_requirements: *
|
71
|
+
version_requirements: *70112209964100
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
name: shoulda
|
74
|
-
requirement: &
|
74
|
+
requirement: &70112209963640 !ruby/object:Gem::Requirement
|
75
75
|
none: false
|
76
76
|
requirements:
|
77
77
|
- - ! '>='
|
@@ -79,10 +79,10 @@ dependencies:
|
|
79
79
|
version: '0'
|
80
80
|
type: :development
|
81
81
|
prerelease: false
|
82
|
-
version_requirements: *
|
82
|
+
version_requirements: *70112209963640
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: sqlite3
|
85
|
-
requirement: &
|
85
|
+
requirement: &70112209994180 !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
88
88
|
- - ! '>='
|
@@ -90,10 +90,10 @@ dependencies:
|
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
|
-
version_requirements: *
|
93
|
+
version_requirements: *70112209994180
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
95
|
name: minitest
|
96
|
-
requirement: &
|
96
|
+
requirement: &70112209993760 !ruby/object:Gem::Requirement
|
97
97
|
none: false
|
98
98
|
requirements:
|
99
99
|
- - ! '>='
|
@@ -101,10 +101,10 @@ dependencies:
|
|
101
101
|
version: '0'
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70112209993760
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
106
|
name: ruby-debug-completion
|
107
|
-
requirement: &
|
107
|
+
requirement: &70112209993340 !ruby/object:Gem::Requirement
|
108
108
|
none: false
|
109
109
|
requirements:
|
110
110
|
- - ! '>='
|
@@ -112,7 +112,7 @@ dependencies:
|
|
112
112
|
version: '0'
|
113
113
|
type: :development
|
114
114
|
prerelease: false
|
115
|
-
version_requirements: *
|
115
|
+
version_requirements: *70112209993340
|
116
116
|
description: AASM is a continuation of the acts as state machine rails plugin, built
|
117
117
|
for plain Ruby objects.
|
118
118
|
email: scott@elitists.net, ttilley@gmail.com
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- spec/models/not_auto_loaded/process.rb
|
150
150
|
- spec/models/process_with_new_dsl.rb
|
151
151
|
- spec/models/silencer.rb
|
152
|
+
- spec/models/sub_classing.rb
|
152
153
|
- spec/models/validator.rb
|
153
154
|
- spec/schema.rb
|
154
155
|
- spec/spec_helper.rb
|
@@ -196,6 +197,7 @@ test_files:
|
|
196
197
|
- spec/models/not_auto_loaded/process.rb
|
197
198
|
- spec/models/process_with_new_dsl.rb
|
198
199
|
- spec/models/silencer.rb
|
200
|
+
- spec/models/sub_classing.rb
|
199
201
|
- spec/models/validator.rb
|
200
202
|
- spec/schema.rb
|
201
203
|
- spec/spec_helper.rb
|