aasm 3.0.24 → 3.1.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.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.travis.yml +23 -4
  4. data/CHANGELOG.md +24 -0
  5. data/Gemfile +9 -1
  6. data/LICENSE +1 -1
  7. data/README.md +65 -12
  8. data/aasm.gemspec +5 -6
  9. data/gemfiles/rails_3.2.gemfile +12 -0
  10. data/gemfiles/rails_4.0.gemfile +11 -0
  11. data/gemfiles/rails_4.1.gemfile +11 -0
  12. data/lib/aasm/aasm.rb +31 -27
  13. data/lib/aasm/base.rb +35 -20
  14. data/lib/aasm/event.rb +27 -16
  15. data/lib/aasm/instance_base.rb +3 -1
  16. data/lib/aasm/localizer.rb +1 -1
  17. data/lib/aasm/persistence/active_record_persistence.rb +27 -9
  18. data/lib/aasm/persistence/base.rb +1 -1
  19. data/lib/aasm/persistence/mongoid_persistence.rb +10 -8
  20. data/lib/aasm/state.rb +1 -0
  21. data/lib/aasm/transition.rb +13 -6
  22. data/lib/aasm/version.rb +1 -1
  23. data/lib/aasm.rb +0 -3
  24. data/spec/database.rb +33 -0
  25. data/spec/models/guardian.rb +48 -0
  26. data/spec/models/mongoid/no_scope_mongoid.rb +1 -1
  27. data/spec/models/mongoid/simple_mongoid.rb +5 -4
  28. data/spec/models/mongoid/simple_new_dsl_mongoid.rb +1 -1
  29. data/spec/models/not_auto_loaded/process.rb +10 -8
  30. data/spec/models/persistence.rb +5 -13
  31. data/spec/spec_helper.rb +1 -1
  32. data/spec/unit/api_spec.rb +12 -12
  33. data/spec/unit/callbacks_spec.rb +29 -45
  34. data/spec/unit/complex_example_spec.rb +15 -15
  35. data/spec/unit/event_spec.rb +89 -76
  36. data/spec/unit/guard_spec.rb +60 -0
  37. data/spec/unit/initial_state_spec.rb +4 -5
  38. data/spec/unit/inspection_spec.rb +40 -53
  39. data/spec/unit/localizer_spec.rb +22 -18
  40. data/spec/unit/new_dsl_spec.rb +2 -2
  41. data/spec/unit/persistence/active_record_persistence_spec.rb +111 -89
  42. data/spec/unit/persistence/mongoid_persistance_spec.rb +102 -81
  43. data/spec/unit/simple_example_spec.rb +20 -21
  44. data/spec/unit/state_spec.rb +16 -16
  45. data/spec/unit/subclassing_spec.rb +8 -8
  46. data/spec/unit/transition_spec.rb +59 -44
  47. metadata +29 -95
  48. data/lib/aasm/deprecated/aasm.rb +0 -15
  49. data/spec/models/callback_old_dsl.rb +0 -41
  50. data/spec/schema.rb +0 -35
@@ -4,46 +4,46 @@ describe 'transitions' do
4
4
 
5
5
  it 'should raise an exception when whiny' do
6
6
  process = ProcessWithNewDsl.new
7
- lambda { process.stop! }.should raise_error(AASM::InvalidTransition)
8
- process.should be_sleeping
7
+ expect { process.stop! }.to raise_error(AASM::InvalidTransition)
8
+ expect(process).to be_sleeping
9
9
  end
10
10
 
11
11
  it 'should not raise an exception when not whiny' do
12
12
  silencer = Silencer.new
13
- silencer.smile!.should be_false
14
- silencer.should be_silent
13
+ expect(silencer.smile!).to be_false
14
+ expect(silencer).to be_silent
15
15
  end
16
16
 
17
17
  it 'should not raise an exception when superclass not whiny' do
18
18
  sub = SubClassing.new
19
- sub.smile!.should be_false
20
- sub.should be_silent
19
+ expect(sub.smile!).to be_false
20
+ expect(sub).to be_silent
21
21
  end
22
22
 
23
23
  it 'should not raise an exception when from is nil even if whiny' do
24
24
  silencer = Silencer.new
25
- silencer.smile_any!.should be_true
26
- silencer.should be_smiling
25
+ expect(silencer.smile_any!).to be_true
26
+ expect(silencer).to be_smiling
27
27
  end
28
28
 
29
29
  it 'should call the block when success' do
30
30
  silencer = Silencer.new
31
31
  success = false
32
- lambda {
32
+ expect {
33
33
  silencer.smile_any! do
34
34
  success = true
35
35
  end
36
- }.should change { success }.to(true)
36
+ }.to change { success }.to(true)
37
37
  end
38
38
 
39
39
  it 'should not call the block when failure' do
40
40
  silencer = Silencer.new
41
41
  success = false
42
- lambda {
42
+ expect {
43
43
  silencer.smile! do
44
44
  success = true
45
45
  end
46
- }.should_not change { success }.to(true)
46
+ }.not_to change { success }.to(true)
47
47
  end
48
48
 
49
49
  end
@@ -56,9 +56,9 @@ describe AASM::Transition do
56
56
  opts = {:from => 'foo', :to => 'bar', :guard => 'g'}
57
57
  st = AASM::Transition.new(opts)
58
58
 
59
- st.from.should == opts[:from]
60
- st.to.should == opts[:to]
61
- st.opts.should == opts
59
+ expect(st.from).to eq(opts[:from])
60
+ expect(st.to).to eq(opts[:to])
61
+ expect(st.opts).to eq(opts)
62
62
  end
63
63
 
64
64
  it 'should pass equality check if from and to are the same' do
@@ -66,10 +66,10 @@ describe AASM::Transition do
66
66
  st = AASM::Transition.new(opts)
67
67
 
68
68
  obj = double('object')
69
- obj.stub(:from).and_return(opts[:from])
70
- obj.stub(:to).and_return(opts[:to])
69
+ allow(obj).to receive(:from).and_return(opts[:from])
70
+ allow(obj).to receive(:to).and_return(opts[:to])
71
71
 
72
- st.should == obj
72
+ expect(st).to eq(obj)
73
73
  end
74
74
 
75
75
  it 'should fail equality check if from are not the same' do
@@ -77,10 +77,10 @@ describe AASM::Transition do
77
77
  st = AASM::Transition.new(opts)
78
78
 
79
79
  obj = double('object')
80
- obj.stub(:from).and_return('blah')
81
- obj.stub(:to).and_return(opts[:to])
80
+ allow(obj).to receive(:from).and_return('blah')
81
+ allow(obj).to receive(:to).and_return(opts[:to])
82
82
 
83
- st.should_not == obj
83
+ expect(st).not_to eq(obj)
84
84
  end
85
85
 
86
86
  it 'should fail equality check if to are not the same' do
@@ -88,10 +88,10 @@ describe AASM::Transition do
88
88
  st = AASM::Transition.new(opts)
89
89
 
90
90
  obj = double('object')
91
- obj.stub(:from).and_return(opts[:from])
92
- obj.stub(:to).and_return('blah')
91
+ allow(obj).to receive(:from).and_return(opts[:from])
92
+ allow(obj).to receive(:to).and_return('blah')
93
93
 
94
- st.should_not == obj
94
+ expect(st).not_to eq(obj)
95
95
  end
96
96
  end
97
97
 
@@ -100,7 +100,7 @@ describe AASM::Transition, '- when performing guard checks' do
100
100
  opts = {:from => 'foo', :to => 'bar'}
101
101
  st = AASM::Transition.new(opts)
102
102
 
103
- st.perform(nil).should be_true
103
+ expect(st.perform(nil)).to be_true
104
104
  end
105
105
 
106
106
  it 'should call the method on the object if guard is a symbol' do
@@ -108,7 +108,7 @@ describe AASM::Transition, '- when performing guard checks' do
108
108
  st = AASM::Transition.new(opts)
109
109
 
110
110
  obj = double('object')
111
- obj.should_receive(:test)
111
+ expect(obj).to receive(:test)
112
112
 
113
113
  st.perform(obj)
114
114
  end
@@ -118,7 +118,7 @@ describe AASM::Transition, '- when performing guard checks' do
118
118
  st = AASM::Transition.new(opts)
119
119
 
120
120
  obj = double('object')
121
- obj.should_receive(:test)
121
+ expect(obj).to receive(:test)
122
122
 
123
123
  st.perform(obj)
124
124
  end
@@ -128,7 +128,7 @@ describe AASM::Transition, '- when performing guard checks' do
128
128
  st = AASM::Transition.new(opts)
129
129
 
130
130
  obj = double('object')
131
- obj.should_receive(:test)
131
+ expect(obj).to receive(:test)
132
132
 
133
133
  st.perform(obj)
134
134
  end
@@ -139,9 +139,9 @@ describe AASM::Transition, '- when executing the transition with a Proc' do
139
139
  opts = {:from => 'foo', :to => 'bar', :on_transition => Proc.new {|o| o.test}}
140
140
  st = AASM::Transition.new(opts)
141
141
  args = {:arg1 => '1', :arg2 => '2'}
142
- obj = double('object')
142
+ obj = double('object', :aasm => 'aasm')
143
143
 
144
- opts[:on_transition].should_receive(:call).with(any_args)
144
+ expect(opts[:on_transition]).to receive(:call).with(any_args)
145
145
 
146
146
  st.execute(obj, args)
147
147
  end
@@ -150,9 +150,9 @@ describe AASM::Transition, '- when executing the transition with a Proc' do
150
150
  opts = {:from => 'foo', :to => 'bar', :on_transition => Proc.new {||}}
151
151
  st = AASM::Transition.new(opts)
152
152
  args = {:arg1 => '1', :arg2 => '2'}
153
- obj = double('object')
153
+ obj = double('object', :aasm => 'aasm')
154
154
 
155
- opts[:on_transition].should_receive(:call).with(no_args)
155
+ expect(opts[:on_transition]).to receive(:call).with(no_args)
156
156
 
157
157
  st.execute(obj, args)
158
158
  end
@@ -163,9 +163,9 @@ describe AASM::Transition, '- when executing the transition with an :on_transtio
163
163
  opts = {:from => 'foo', :to => 'bar', :on_transition => 'test'}
164
164
  st = AASM::Transition.new(opts)
165
165
  args = {:arg1 => '1', :arg2 => '2'}
166
- obj = double('object')
166
+ obj = double('object', :aasm => 'aasm')
167
167
 
168
- obj.should_receive(:test)
168
+ expect(obj).to receive(:test)
169
169
 
170
170
  st.execute(obj, args)
171
171
  end
@@ -174,9 +174,9 @@ describe AASM::Transition, '- when executing the transition with an :on_transtio
174
174
  opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
175
175
  st = AASM::Transition.new(opts)
176
176
  args = {:arg1 => '1', :arg2 => '2'}
177
- obj = double('object')
177
+ obj = double('object', :aasm => 'aasm')
178
178
 
179
- obj.should_receive(:test)
179
+ expect(obj).to receive(:test)
180
180
 
181
181
  st.execute(obj, args)
182
182
  end
@@ -185,30 +185,45 @@ describe AASM::Transition, '- when executing the transition with an :on_transtio
185
185
  opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
186
186
  st = AASM::Transition.new(opts)
187
187
  args = {:arg1 => '1', :arg2 => '2'}
188
- obj = double('object')
188
+ obj = double('object', :aasm => 'aasm')
189
189
 
190
- obj.class.class_eval do
191
- define_method(:test) {|*args| 'success'}
190
+ def obj.test(args)
191
+ "arg1: #{args[:arg1]} arg2: #{args[:arg2]}"
192
192
  end
193
193
 
194
194
  return_value = st.execute(obj, args)
195
195
 
196
- return_value.should == 'success'
196
+ expect(return_value).to eq('arg1: 1 arg2: 2')
197
197
  end
198
198
 
199
199
  it 'should NOT pass args if the target method does NOT accept them' do
200
200
  opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
201
201
  st = AASM::Transition.new(opts)
202
202
  args = {:arg1 => '1', :arg2 => '2'}
203
- obj = double('object')
203
+ obj = double('object', :aasm => 'aasm')
204
+
205
+ def obj.test
206
+ 'success'
207
+ end
208
+
209
+ return_value = st.execute(obj, args)
210
+
211
+ expect(return_value).to eq('success')
212
+ end
213
+
214
+ it 'should allow accessing the from_state and the to_state' do
215
+ opts = {:from => 'foo', :to => 'bar', :on_transition => :test}
216
+ st = AASM::Transition.new(opts)
217
+ args = {:arg1 => '1', :arg2 => '2'}
218
+ obj = double('object', :aasm => AASM::InstanceBase.new('object'))
204
219
 
205
- obj.class.class_eval do
206
- define_method(:test) {|*args| 'success'}
220
+ def obj.test(args)
221
+ "from: #{aasm.from_state} to: #{aasm.to_state}"
207
222
  end
208
223
 
209
224
  return_value = st.execute(obj, args)
210
225
 
211
- return_value.should == 'success'
226
+ expect(return_value).to eq('from: foo to: bar')
212
227
  end
213
228
 
214
229
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aasm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.24
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Barron
@@ -11,162 +11,92 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-11-20 00:00:00.000000000 Z
14
+ date: 2014-03-01 00:00:00.000000000 Z
15
15
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: activerecord
18
- requirement: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - '='
21
- - !ruby/object:Gem::Version
22
- version: 3.2.15
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - '='
28
- - !ruby/object:Gem::Version
29
- version: 3.2.15
30
- - !ruby/object:Gem::Dependency
31
- name: mongoid
32
- requirement: !ruby/object:Gem::Requirement
33
- requirements:
34
- - - '>='
35
- - !ruby/object:Gem::Version
36
- version: '0'
37
- type: :development
38
- prerelease: false
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
16
  - !ruby/object:Gem::Dependency
45
17
  name: rake
46
18
  requirement: !ruby/object:Gem::Requirement
47
19
  requirements:
48
- - - '>='
20
+ - - ">="
49
21
  - !ruby/object:Gem::Version
50
22
  version: '0'
51
23
  type: :development
52
24
  prerelease: false
53
25
  version_requirements: !ruby/object:Gem::Requirement
54
26
  requirements:
55
- - - '>='
27
+ - - ">="
56
28
  - !ruby/object:Gem::Version
57
29
  version: '0'
58
30
  - !ruby/object:Gem::Dependency
59
31
  name: sdoc
60
32
  requirement: !ruby/object:Gem::Requirement
61
33
  requirements:
62
- - - '>='
34
+ - - ">="
63
35
  - !ruby/object:Gem::Version
64
36
  version: '0'
65
37
  type: :development
66
38
  prerelease: false
67
39
  version_requirements: !ruby/object:Gem::Requirement
68
40
  requirements:
69
- - - '>='
41
+ - - ">="
70
42
  - !ruby/object:Gem::Version
71
43
  version: '0'
72
44
  - !ruby/object:Gem::Dependency
73
45
  name: rspec
74
46
  requirement: !ruby/object:Gem::Requirement
75
47
  requirements:
76
- - - ~>
48
+ - - ">="
77
49
  - !ruby/object:Gem::Version
78
50
  version: '2.14'
79
51
  type: :development
80
52
  prerelease: false
81
53
  version_requirements: !ruby/object:Gem::Requirement
82
54
  requirements:
83
- - - ~>
55
+ - - ">="
84
56
  - !ruby/object:Gem::Version
85
57
  version: '2.14'
86
58
  - !ruby/object:Gem::Dependency
87
59
  name: rr
88
60
  requirement: !ruby/object:Gem::Requirement
89
61
  requirements:
90
- - - '>='
62
+ - - ">="
91
63
  - !ruby/object:Gem::Version
92
64
  version: '0'
93
65
  type: :development
94
66
  prerelease: false
95
67
  version_requirements: !ruby/object:Gem::Requirement
96
68
  requirements:
97
- - - '>='
98
- - !ruby/object:Gem::Version
99
- version: '0'
100
- - !ruby/object:Gem::Dependency
101
- name: sqlite3
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - '>='
105
- - !ruby/object:Gem::Version
106
- version: '0'
107
- type: :development
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - '>='
69
+ - - ">="
112
70
  - !ruby/object:Gem::Version
113
71
  version: '0'
114
72
  - !ruby/object:Gem::Dependency
115
73
  name: minitest
116
74
  requirement: !ruby/object:Gem::Requirement
117
75
  requirements:
118
- - - '>='
119
- - !ruby/object:Gem::Version
120
- version: '0'
121
- type: :development
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - '>='
126
- - !ruby/object:Gem::Version
127
- version: '0'
128
- - !ruby/object:Gem::Dependency
129
- name: ruby-debug-completion
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - '>='
76
+ - - ">="
133
77
  - !ruby/object:Gem::Version
134
78
  version: '0'
135
79
  type: :development
136
80
  prerelease: false
137
81
  version_requirements: !ruby/object:Gem::Requirement
138
82
  requirements:
139
- - - '>='
83
+ - - ">="
140
84
  - !ruby/object:Gem::Version
141
85
  version: '0'
142
86
  - !ruby/object:Gem::Dependency
143
87
  name: mime-types
144
88
  requirement: !ruby/object:Gem::Requirement
145
89
  requirements:
146
- - - ~>
90
+ - - "~>"
147
91
  - !ruby/object:Gem::Version
148
92
  version: '1.25'
149
93
  type: :development
150
94
  prerelease: false
151
95
  version_requirements: !ruby/object:Gem::Requirement
152
96
  requirements:
153
- - - ~>
97
+ - - "~>"
154
98
  - !ruby/object:Gem::Version
155
99
  version: '1.25'
156
- - !ruby/object:Gem::Dependency
157
- name: coveralls
158
- requirement: !ruby/object:Gem::Requirement
159
- requirements:
160
- - - '>='
161
- - !ruby/object:Gem::Version
162
- version: '0'
163
- type: :development
164
- prerelease: false
165
- version_requirements: !ruby/object:Gem::Requirement
166
- requirements:
167
- - - '>='
168
- - !ruby/object:Gem::Version
169
- version: '0'
170
100
  description: AASM is a continuation of the acts as state machine rails plugin, built
171
101
  for plain Ruby objects.
172
102
  email: scott@elitists.net, ttilley@gmail.com, aasm@mt7.de
@@ -174,9 +104,9 @@ executables: []
174
104
  extensions: []
175
105
  extra_rdoc_files: []
176
106
  files:
177
- - .document
178
- - .gitignore
179
- - .travis.yml
107
+ - ".document"
108
+ - ".gitignore"
109
+ - ".travis.yml"
180
110
  - API
181
111
  - CHANGELOG.md
182
112
  - Gemfile
@@ -185,10 +115,12 @@ files:
185
115
  - README.md
186
116
  - Rakefile
187
117
  - aasm.gemspec
118
+ - gemfiles/rails_3.2.gemfile
119
+ - gemfiles/rails_4.0.gemfile
120
+ - gemfiles/rails_4.1.gemfile
188
121
  - lib/aasm.rb
189
122
  - lib/aasm/aasm.rb
190
123
  - lib/aasm/base.rb
191
- - lib/aasm/deprecated/aasm.rb
192
124
  - lib/aasm/errors.rb
193
125
  - lib/aasm/event.rb
194
126
  - lib/aasm/instance_base.rb
@@ -201,6 +133,7 @@ files:
201
133
  - lib/aasm/state_machine.rb
202
134
  - lib/aasm/transition.rb
203
135
  - lib/aasm/version.rb
136
+ - spec/database.rb
204
137
  - spec/database.yml
205
138
  - spec/en.yml
206
139
  - spec/en_deprecated_style.yml
@@ -209,10 +142,10 @@ files:
209
142
  - spec/models/auth_machine.rb
210
143
  - spec/models/bar.rb
211
144
  - spec/models/callback_new_dsl.rb
212
- - spec/models/callback_old_dsl.rb
213
145
  - spec/models/conversation.rb
214
146
  - spec/models/father.rb
215
147
  - spec/models/foo.rb
148
+ - spec/models/guardian.rb
216
149
  - spec/models/invalid_persistor.rb
217
150
  - spec/models/mongoid/no_scope_mongoid.rb
218
151
  - spec/models/mongoid/simple_mongoid.rb
@@ -228,12 +161,12 @@ files:
228
161
  - spec/models/transactor.rb
229
162
  - spec/models/validator.rb
230
163
  - spec/models/worker.rb
231
- - spec/schema.rb
232
164
  - spec/spec_helper.rb
233
165
  - spec/unit/api_spec.rb
234
166
  - spec/unit/callbacks_spec.rb
235
167
  - spec/unit/complex_example_spec.rb
236
168
  - spec/unit/event_spec.rb
169
+ - spec/unit/guard_spec.rb
237
170
  - spec/unit/initial_state_spec.rb
238
171
  - spec/unit/inspection_spec.rb
239
172
  - spec/unit/localizer_spec.rb
@@ -255,21 +188,22 @@ require_paths:
255
188
  - lib
256
189
  required_ruby_version: !ruby/object:Gem::Requirement
257
190
  requirements:
258
- - - '>='
191
+ - - ">="
259
192
  - !ruby/object:Gem::Version
260
193
  version: '0'
261
194
  required_rubygems_version: !ruby/object:Gem::Requirement
262
195
  requirements:
263
- - - '>='
196
+ - - ">="
264
197
  - !ruby/object:Gem::Version
265
198
  version: '0'
266
199
  requirements: []
267
200
  rubyforge_project:
268
- rubygems_version: 2.1.11
201
+ rubygems_version: 2.2.2
269
202
  signing_key:
270
203
  specification_version: 4
271
204
  summary: State machine mixin for Ruby objects
272
205
  test_files:
206
+ - spec/database.rb
273
207
  - spec/database.yml
274
208
  - spec/en.yml
275
209
  - spec/en_deprecated_style.yml
@@ -278,10 +212,10 @@ test_files:
278
212
  - spec/models/auth_machine.rb
279
213
  - spec/models/bar.rb
280
214
  - spec/models/callback_new_dsl.rb
281
- - spec/models/callback_old_dsl.rb
282
215
  - spec/models/conversation.rb
283
216
  - spec/models/father.rb
284
217
  - spec/models/foo.rb
218
+ - spec/models/guardian.rb
285
219
  - spec/models/invalid_persistor.rb
286
220
  - spec/models/mongoid/no_scope_mongoid.rb
287
221
  - spec/models/mongoid/simple_mongoid.rb
@@ -297,12 +231,12 @@ test_files:
297
231
  - spec/models/transactor.rb
298
232
  - spec/models/validator.rb
299
233
  - spec/models/worker.rb
300
- - spec/schema.rb
301
234
  - spec/spec_helper.rb
302
235
  - spec/unit/api_spec.rb
303
236
  - spec/unit/callbacks_spec.rb
304
237
  - spec/unit/complex_example_spec.rb
305
238
  - spec/unit/event_spec.rb
239
+ - spec/unit/guard_spec.rb
306
240
  - spec/unit/initial_state_spec.rb
307
241
  - spec/unit/inspection_spec.rb
308
242
  - spec/unit/localizer_spec.rb
@@ -1,15 +0,0 @@
1
- module AASM
2
-
3
- module ClassMethods
4
- def human_event_name(*args)
5
- warn "AASM.human_event_name is deprecated and will be removed in version 3.1.0; please use AASM.aasm_human_event_name instead!"
6
- aasm_human_event_name(*args)
7
- end
8
- end
9
-
10
- def human_state
11
- warn "AASM#human_state is deprecated and will be removed in version 3.1.0; please use AASM#aasm_human_state instead!"
12
- aasm_human_state
13
- end
14
-
15
- end
@@ -1,41 +0,0 @@
1
- class CallbackOldDsl
2
- include AASM
3
-
4
- aasm_initial_state :open
5
- aasm_state :open,
6
- :before_enter => :before_enter_open,
7
- :after_enter => :after_enter_open,
8
- :before_exit => :before_exit_open,
9
- :exit => :exit_open,
10
- :after_exit => :after_exit_open
11
- aasm_state :closed,
12
- :before_enter => :before_enter_closed,
13
- :enter => :enter_closed,
14
- :after_enter => :after_enter_closed,
15
- :before_exit => :before_exit_closed,
16
- :after_exit => :after_exit_closed
17
-
18
- aasm_event :close, :before => :before, :after => :after do
19
- transitions :to => :closed, :from => [:open]
20
- end
21
-
22
- aasm_event :open, :before => :before, :after => :after do
23
- transitions :to => :open, :from => :closed
24
- end
25
-
26
- def before_enter_open; end
27
- def before_exit_open; end
28
- def after_enter_open; end
29
- def after_exit_open; end
30
-
31
- def before_enter_closed; end
32
- def before_exit_closed; end
33
- def after_enter_closed; end
34
- def after_exit_closed; end
35
-
36
- def before; end
37
- def after; end
38
-
39
- def enter_closed; end
40
- def exit_open; end
41
- end
data/spec/schema.rb DELETED
@@ -1,35 +0,0 @@
1
- ActiveRecord::Schema.define(:version => 0) do
2
-
3
- %w{gates readers writers transients simples simple_new_dsls no_scopes thieves localizer_test_models persisted_states provided_and_persisted_states}.each do |table_name|
4
- create_table table_name, :force => true do |t|
5
- t.string "aasm_state"
6
- end
7
- end
8
-
9
- create_table "validators", :force => true do |t|
10
- t.string "name"
11
- t.string "status"
12
- end
13
-
14
- create_table "transactors", :force => true do |t|
15
- t.string "name"
16
- t.string "status"
17
- t.integer "worker_id"
18
- end
19
-
20
- create_table "workers", :force => true do |t|
21
- t.string "name"
22
- t.string "status"
23
- end
24
-
25
- create_table "invalid_persistors", :force => true do |t|
26
- t.string "name"
27
- t.string "status"
28
- end
29
-
30
- create_table "fathers", :force => true do |t|
31
- t.string "aasm_state"
32
- t.string "type"
33
- end
34
-
35
- end