workflow_on_mongoid 0.8.0.4 → 0.8.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,6 @@ module Workflow
|
|
26
26
|
klass.send :include, RemodelInstanceMethods
|
27
27
|
elsif Object.const_defined?(:Mongoid) && klass < Mongoid::Document
|
28
28
|
klass.class_eval do
|
29
|
-
klass.send :field, klass.workflow_column
|
30
29
|
klass.send :include, MongoidInstanceMethods
|
31
30
|
klass.before_validation :write_initial_state
|
32
31
|
end
|
data/test/mongoid_test.rb
CHANGED
@@ -17,6 +17,7 @@ class MongoidOrder
|
|
17
17
|
include Mongoid::Document
|
18
18
|
|
19
19
|
field :title
|
20
|
+
field :workflow_state
|
20
21
|
|
21
22
|
include Workflow
|
22
23
|
workflow do
|
@@ -140,6 +141,7 @@ class MongoidTest < MongoidTestCase
|
|
140
141
|
test 'default workflow column should be workflow_state' do
|
141
142
|
o = assert_state 'some MongoidOrder', 'accepted'
|
142
143
|
assert_equal :workflow_state, o.class.workflow_column
|
144
|
+
assert MongoidOrder.fields.keys.include?('workflow_state')
|
143
145
|
end
|
144
146
|
|
145
147
|
test 'custom workflow column should be foo_bar' do
|
@@ -147,6 +149,10 @@ class MongoidTest < MongoidTestCase
|
|
147
149
|
assert_equal :foo_bar, o.class.workflow_column
|
148
150
|
end
|
149
151
|
|
152
|
+
test 'should not have workflow_state column if custom workflow_column is specified' do
|
153
|
+
assert !( MongoidLegacyOrder.fields.keys.include?('workflow_state') )
|
154
|
+
end
|
155
|
+
|
150
156
|
test 'access workflow specification' do
|
151
157
|
assert_equal 3, MongoidOrder.workflow_spec.states.length
|
152
158
|
assert_equal ['submitted', 'accepted', 'shipped'].sort,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workflow_on_mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
9
|
- 0
|
10
|
-
-
|
11
|
-
version: 0.8.0.
|
10
|
+
- 5
|
11
|
+
version: 0.8.0.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Mani Tadayon
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
20
|
-
default_executable:
|
19
|
+
date: 2011-09-20 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: workflow
|
@@ -181,7 +180,6 @@ files:
|
|
181
180
|
- test/test_helper.rb
|
182
181
|
- test/without_active_record_test.rb
|
183
182
|
- workflow_on_mongoid.gemspec
|
184
|
-
has_rdoc: true
|
185
183
|
homepage: http://github.com/bowsersenior/workflow_on_mongoid
|
186
184
|
licenses: []
|
187
185
|
|
@@ -213,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
211
|
requirements: []
|
214
212
|
|
215
213
|
rubyforge_project:
|
216
|
-
rubygems_version: 1.6
|
214
|
+
rubygems_version: 1.8.6
|
217
215
|
signing_key:
|
218
216
|
specification_version: 3
|
219
217
|
summary: Add Mongoid support to the Workflow gem.
|