state_machines-mongoid 0.0.0 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/.travis.yml +20 -0
- data/Appraisals +8 -0
- data/Gemfile +0 -2
- data/LICENSE.txt +1 -0
- data/README.md +43 -4
- data/Rakefile +8 -1
- data/gemfiles/active_model_4.1.gemfile +7 -0
- data/gemfiles/active_model_4.2.gemfile +7 -0
- data/lib/state_machines-mongoid.rb +1 -0
- data/lib/state_machines/integrations/mongoid.rb +401 -0
- data/lib/state_machines/integrations/mongoid/locale.rb +11 -0
- data/lib/state_machines/integrations/mongoid/version.rb +7 -0
- data/lib/state_machines/state_machines-mongoid.rb +1 -0
- data/state_machines-mongoid.gemspec +18 -12
- data/test/files/en.yml +5 -0
- data/test/integration_test.rb +23 -0
- data/test/machine_by_default_test.rb +16 -0
- data/test/machine_errors_test.rb +20 -0
- data/test/machine_multiple_test.rb +17 -0
- data/test/machine_nested_action_test.rb +39 -0
- data/test/machine_with_aliased_attribute_test.rb +22 -0
- data/test/machine_with_aliased_field_test.rb +22 -0
- data/test/machine_with_callbacks_test.rb +167 -0
- data/test/machine_with_column_state_attribute_test.rb +44 -0
- data/test/machine_with_complex_pluralization_scopes_test.rb +16 -0
- data/test/machine_with_conflicting_predicate_test.rb +27 -0
- data/test/machine_with_conflicting_state_name_test.rb +29 -0
- data/test/machine_with_custom_attribute_test.rb +21 -0
- data/test/machine_with_default_scope_test.rb +14 -0
- data/test/machine_with_different_column_default_test.rb +26 -0
- data/test/machine_with_different_integer_column_default_test.rb +27 -0
- data/test/machine_with_different_same_default_test.rb +26 -0
- data/test/machine_with_dirty_attribute_and_custom_attributes_during_loopback_test.rb +24 -0
- data/test/machine_with_dirty_attribute_and_state_events_test.rb +20 -0
- data/test/machine_with_dirty_attributes_and_custom_attribute_test.rb +32 -0
- data/test/machine_with_dirty_attributes_during_loopback_test.rb +22 -0
- data/test/machine_with_dirty_attributes_test.rb +35 -0
- data/test/machine_with_dynamic_initial_state_test.rb +99 -0
- data/test/machine_with_event_attributes_on_autosave_test.rb +50 -0
- data/test/machine_with_event_attributes_on_custom_action_test.rb +40 -0
- data/test/machine_with_event_attributes_on_save_bang_test.rb +82 -0
- data/test/machine_with_event_attributes_on_save_test.rb +146 -0
- data/test/machine_with_event_attributes_on_validation_test.rb +115 -0
- data/test/machine_with_events_test.rb +13 -0
- data/test/machine_with_failed_action_test.rb +39 -0
- data/test/machine_with_failed_after_callbacks_test.rb +35 -0
- data/test/machine_with_failed_before_callbacks_test.rb +36 -0
- data/test/machine_with_field_test.rb +16 -0
- data/test/machine_with_initialized_state_test.rb +35 -0
- data/test/machine_with_internationalization_test.rb +175 -0
- data/test/machine_with_loopback_test.rb +26 -0
- data/test/machine_with_non_column_state_attribute_defined_test.rb +35 -0
- data/test/machine_with_non_column_state_attribute_undefined_test.rb +33 -0
- data/test/machine_with_scopes_and_owner_subclass_test.rb +42 -0
- data/test/machine_with_scopes_test.rb +69 -0
- data/test/machine_with_state_driven_validations_test.rb +33 -0
- data/test/machine_with_state_test.rb +13 -0
- data/test/machine_with_static_initial_state_test.rb +162 -0
- data/test/machine_with_validations_and_custom_attribute_test.rb +21 -0
- data/test/machine_with_validations_test.rb +46 -0
- data/test/machine_without_field_test.rb +14 -0
- data/test/test_helper.rb +90 -0
- metadata +170 -9
- data/lib/state_machines/mongoid.rb +0 -7
- data/lib/state_machines/mongoid/version.rb +0 -5
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithStateDrivenValidationsTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model do
|
6
|
+
field :seatbelt, :type => Boolean
|
7
|
+
end
|
8
|
+
|
9
|
+
@machine = StateMachines::Machine.new(@model)
|
10
|
+
@machine.state :first_gear do
|
11
|
+
validates_presence_of :seatbelt, :key => :first_gear
|
12
|
+
end
|
13
|
+
@machine.state :second_gear do
|
14
|
+
validates_presence_of :seatbelt, :key => :second_gear
|
15
|
+
end
|
16
|
+
@machine.other_states :parked
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_should_be_valid_if_validation_fails_outside_state_scope
|
20
|
+
record = @model.new(:state => 'parked', :seatbelt => nil)
|
21
|
+
assert record.valid?
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_should_be_invalid_if_validation_fails_within_state_scope
|
25
|
+
record = @model.new(:state => 'first_gear', :seatbelt => nil)
|
26
|
+
assert !record.valid?
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_should_be_valid_if_validation_succeeds_within_state_scope
|
30
|
+
record = @model.new(:state => 'second_gear', :seatbelt => true)
|
31
|
+
assert record.valid?
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithStatesTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model
|
6
|
+
@machine = StateMachines::Machine.new(@model)
|
7
|
+
@machine.state :first_gear
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_should_humanize_name
|
11
|
+
assert_equal 'first gear', @machine.state(:first_gear).human_name
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithStaticInitialStateTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model(:vehicle) do
|
6
|
+
attr_accessor :value
|
7
|
+
end
|
8
|
+
@machine = StateMachines::Machine.new(@model, :initial => :parked)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_should_set_initial_state_on_created_object
|
12
|
+
record = @model.new
|
13
|
+
assert_equal 'parked', record.state
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_should_set_initial_state_with_nil_attributes
|
17
|
+
record = @model.new(nil)
|
18
|
+
assert_equal 'parked', record.state
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_should_still_set_attributes
|
22
|
+
record = @model.new(:value => 1)
|
23
|
+
assert_equal 1, record.value
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_should_still_allow_initialize_blocks
|
27
|
+
block_args = nil
|
28
|
+
record = @model.new do |*args|
|
29
|
+
block_args = args
|
30
|
+
end
|
31
|
+
|
32
|
+
assert_equal [record], block_args
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_should_set_attributes_prior_to_initialize_block
|
36
|
+
state = nil
|
37
|
+
@model.new do |record|
|
38
|
+
state = record.state
|
39
|
+
end
|
40
|
+
|
41
|
+
assert_equal 'parked', state
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_should_set_attributes_prior_to_after_initialize_hook
|
45
|
+
state = nil
|
46
|
+
@model.after_initialize do |record|
|
47
|
+
state = record.state
|
48
|
+
end
|
49
|
+
@model.new
|
50
|
+
assert_equal 'parked', state
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_should_persist_initial_state
|
54
|
+
record = @model.new
|
55
|
+
record.save
|
56
|
+
record.reload
|
57
|
+
assert_equal 'parked', record.state
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_should_persist_initial_state_on_dup
|
61
|
+
record = @model.create.dup
|
62
|
+
record.save
|
63
|
+
record.reload
|
64
|
+
assert_equal 'parked', record.state
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_should_set_initial_state_before_setting_attributes
|
68
|
+
@model.class_eval do
|
69
|
+
attr_accessor :state_during_setter
|
70
|
+
|
71
|
+
remove_method :value=
|
72
|
+
define_method(:value=) do |value|
|
73
|
+
self.state_during_setter = state
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
record = @model.new(:value => 1)
|
78
|
+
assert_equal 'parked', record.state_during_setter
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_should_not_set_initial_state_after_already_initialized
|
82
|
+
record = @model.new(:value => 1)
|
83
|
+
assert_equal 'parked', record.state
|
84
|
+
|
85
|
+
record.state = 'idling'
|
86
|
+
record.attributes = {}
|
87
|
+
assert_equal 'idling', record.state
|
88
|
+
end
|
89
|
+
|
90
|
+
def test_should_use_stored_values_when_loading_from_database
|
91
|
+
@machine.state :idling
|
92
|
+
|
93
|
+
record = @model.find(@model.create(:state => 'idling').id)
|
94
|
+
assert_equal 'idling', record.state
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_should_use_stored_values_when_loading_from_database_with_nil_state
|
98
|
+
@machine.state nil
|
99
|
+
|
100
|
+
record = @model.find(@model.create(:state => nil).id)
|
101
|
+
assert_nil record.state
|
102
|
+
end
|
103
|
+
|
104
|
+
if Mongoid::VERSION >= '2.1.0'
|
105
|
+
def test_should_use_stored_values_when_loading_for_many_association
|
106
|
+
@machine.state :idling
|
107
|
+
|
108
|
+
@model.belongs_to :owner, :class_name => 'MongoidTest::Owner'
|
109
|
+
MongoidTest.const_set('Vehicle', @model)
|
110
|
+
|
111
|
+
owner_model = new_model(:owner) do
|
112
|
+
has_many :vehicles, :class_name => 'MongoidTest::Vehicle'
|
113
|
+
end
|
114
|
+
MongoidTest.const_set('Owner', owner_model)
|
115
|
+
|
116
|
+
owner = owner_model.create
|
117
|
+
record = @model.create(:state => 'idling', :owner_id => owner.id)
|
118
|
+
assert_equal 'idling', owner.vehicles[0].state
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_should_use_stored_values_when_loading_for_one_association
|
122
|
+
@machine.state :idling
|
123
|
+
|
124
|
+
@model.belongs_to :owner, :class_name => 'MongoidTest::Owner'
|
125
|
+
MongoidTest.const_set('Vehicle', @model)
|
126
|
+
|
127
|
+
owner_model = new_model(:owner) do
|
128
|
+
has_one :vehicle, :class_name => 'MongoidTest::Vehicle'
|
129
|
+
end
|
130
|
+
MongoidTest.const_set('Owner', owner_model)
|
131
|
+
|
132
|
+
owner = owner_model.create
|
133
|
+
record = @model.create(:state => 'idling', :owner_id => owner.id)
|
134
|
+
owner.reload
|
135
|
+
assert_equal 'idling', owner.vehicle.state
|
136
|
+
end
|
137
|
+
|
138
|
+
def test_should_use_stored_values_when_loading_for_belongs_to_association
|
139
|
+
@machine.state :idling
|
140
|
+
|
141
|
+
MongoidTest.const_set('Vehicle', @model)
|
142
|
+
|
143
|
+
driver_model = new_model(:driver) do
|
144
|
+
belongs_to :vehicle, :class_name => 'MongoidTest::Vehicle'
|
145
|
+
end
|
146
|
+
MongoidTest.const_set('Driver', driver_model)
|
147
|
+
|
148
|
+
record = @model.create(:state => 'idling')
|
149
|
+
driver = driver_model.create(:vehicle_id => record.id)
|
150
|
+
assert_equal 'idling', driver.vehicle.state
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def teardown
|
155
|
+
MongoidTest.class_eval do
|
156
|
+
remove_const('Vehicle') if defined?(MongoidTest::Vehicle)
|
157
|
+
remove_const('Owner') if defined?(MongoidTest::Owner)
|
158
|
+
remove_const('Driver') if defined?(MongoidTest::Driver)
|
159
|
+
end
|
160
|
+
super
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithValidationsAndCustomAttributeTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model
|
6
|
+
@machine = StateMachines::Machine.new(@model, :status, :attribute => :state)
|
7
|
+
@machine.state :parked
|
8
|
+
|
9
|
+
@record = @model.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_should_add_validation_errors_to_custom_attribute
|
13
|
+
@record.state = 'invalid'
|
14
|
+
|
15
|
+
assert !@record.valid?
|
16
|
+
assert_equal ['State is invalid'], @record.errors.full_messages
|
17
|
+
|
18
|
+
@record.state = 'parked'
|
19
|
+
assert @record.valid?
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithValidationsTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model
|
6
|
+
@machine = StateMachines::Machine.new(@model)
|
7
|
+
@machine.state :parked
|
8
|
+
|
9
|
+
@record = @model.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_should_invalidate_using_errors
|
13
|
+
I18n.backend = I18n::Backend::Simple.new if Object.const_defined?(:ActiveModel)
|
14
|
+
@record.state = 'parked'
|
15
|
+
|
16
|
+
@machine.invalidate(@record, :state, :invalid_transition, [[:event, 'park']])
|
17
|
+
assert_equal ['State cannot transition via "park"'], @record.errors.full_messages
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_should_auto_prefix_custom_attributes_on_invalidation
|
21
|
+
@machine.invalidate(@record, :event, :invalid)
|
22
|
+
|
23
|
+
assert_equal ['State event is invalid'], @record.errors.full_messages
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_should_clear_errors_on_reset
|
27
|
+
@record.state = 'parked'
|
28
|
+
@record.errors.add(:state, 'is invalid')
|
29
|
+
|
30
|
+
@machine.reset(@record)
|
31
|
+
assert_equal [], @record.errors.full_messages
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_should_be_valid_if_state_is_known
|
35
|
+
@record.state = 'parked'
|
36
|
+
|
37
|
+
assert @record.valid?
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_should_not_be_valid_if_state_is_unknown
|
41
|
+
@record.state = 'invalid'
|
42
|
+
|
43
|
+
assert !@record.valid?
|
44
|
+
assert_equal ['State is invalid'], @record.errors.full_messages
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require_relative 'test_helper'
|
2
|
+
|
3
|
+
class MachineWithoutFieldTest < BaseTestCase
|
4
|
+
def setup
|
5
|
+
@model = new_model
|
6
|
+
StateMachines::Machine.new(@model, :status)
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_should_define_field_with_string_type
|
10
|
+
field = @model.fields['status']
|
11
|
+
refute_nil field
|
12
|
+
assert_equal String, field.type
|
13
|
+
end
|
14
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'minitest/reporters'
|
2
|
+
Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
|
3
|
+
require 'state_machines-mongoid'
|
4
|
+
require 'minitest/autorun'
|
5
|
+
|
6
|
+
# Env variables can be set to test to another database
|
7
|
+
ENV['MONGO_HOST'] ||= 'localhost'
|
8
|
+
ENV['MONGO_PORT'] ||= '27017'
|
9
|
+
|
10
|
+
HOST = ENV['MONGO_HOST']
|
11
|
+
PORT = ENV['MONGO_PORT'].to_i
|
12
|
+
DB_NAME = 'state-machines-mongoid_test'
|
13
|
+
|
14
|
+
CONFIG = {
|
15
|
+
sessions: {
|
16
|
+
default: {
|
17
|
+
database: DB_NAME,
|
18
|
+
hosts: [ "#{HOST}:#{PORT}" ]
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
# Set the database that the spec suite connects to.
|
24
|
+
Mongoid.configure do |config|
|
25
|
+
config.load_configuration(CONFIG)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Module for test models
|
29
|
+
module MongoidTest
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
class BaseTestCase < Minitest::Test
|
34
|
+
def default_test
|
35
|
+
end
|
36
|
+
|
37
|
+
def teardown
|
38
|
+
if @table_names
|
39
|
+
db = Mongoid::Sessions.default
|
40
|
+
db.collections.each {|c| c.drop if @table_names.include?(c.name)}
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
protected
|
45
|
+
# Creates a new Mongoid model (and the associated table)
|
46
|
+
def new_model(name = :foo, &block)
|
47
|
+
table_name = "#{name}_#{rand(1000000)}"
|
48
|
+
@table_names ||= []
|
49
|
+
@table_names << table_name
|
50
|
+
|
51
|
+
model = Class.new do
|
52
|
+
(class << self; self; end).class_eval do
|
53
|
+
define_method(:name) { "MongoidTest::#{name.to_s.capitalize}" }
|
54
|
+
define_method(:to_s) { self.name }
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
model.class_eval do
|
59
|
+
include Mongoid::Document
|
60
|
+
store_in collection: table_name
|
61
|
+
|
62
|
+
field :state, :type => String
|
63
|
+
end
|
64
|
+
model.class_eval(&block) if block_given?
|
65
|
+
model
|
66
|
+
end
|
67
|
+
|
68
|
+
# Creates a new Mongoid observer
|
69
|
+
def new_observer(model, &block)
|
70
|
+
observer = Class.new(Mongoid::Observer) do
|
71
|
+
attr_accessor :notifications
|
72
|
+
|
73
|
+
def initialize
|
74
|
+
super
|
75
|
+
@notifications = []
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
(class << observer; self; end).class_eval do
|
80
|
+
define_method(:name) do
|
81
|
+
"#{model.name}Observer"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
observer.observe(model)
|
86
|
+
observer.class_eval(&block) if block_given?
|
87
|
+
observer
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
metadata
CHANGED
@@ -1,31 +1,88 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines-mongoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
|
+
- Aaron Pfeifer
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2015-02-11 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: state_machines-activemodel
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: mongoid
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 4.0.0
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 4.0.0
|
13
42
|
- !ruby/object:Gem::Dependency
|
14
43
|
name: bundler
|
15
44
|
requirement: !ruby/object:Gem::Requirement
|
16
45
|
requirements:
|
17
|
-
- - "
|
46
|
+
- - ">="
|
18
47
|
- !ruby/object:Gem::Version
|
19
48
|
version: '1.6'
|
20
49
|
type: :development
|
21
50
|
prerelease: false
|
22
51
|
version_requirements: !ruby/object:Gem::Requirement
|
23
52
|
requirements:
|
24
|
-
- - "
|
53
|
+
- - ">="
|
25
54
|
- !ruby/object:Gem::Version
|
26
55
|
version: '1.6'
|
27
56
|
- !ruby/object:Gem::Dependency
|
28
57
|
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '10.3'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '10.3'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: minitest
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 5.4.1
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 5.4.1
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: minitest-reporters
|
29
86
|
requirement: !ruby/object:Gem::Requirement
|
30
87
|
requirements:
|
31
88
|
- - ">="
|
@@ -41,18 +98,74 @@ dependencies:
|
|
41
98
|
description: Mongoid integration for state machines gem
|
42
99
|
email:
|
43
100
|
- terminale@gmail.com
|
101
|
+
- aaron@pluginaweek.org
|
44
102
|
executables: []
|
45
103
|
extensions: []
|
46
104
|
extra_rdoc_files: []
|
47
105
|
files:
|
48
106
|
- ".gitignore"
|
107
|
+
- ".travis.yml"
|
108
|
+
- Appraisals
|
49
109
|
- Gemfile
|
50
110
|
- LICENSE.txt
|
51
111
|
- README.md
|
52
112
|
- Rakefile
|
53
|
-
-
|
54
|
-
-
|
113
|
+
- gemfiles/active_model_4.1.gemfile
|
114
|
+
- gemfiles/active_model_4.2.gemfile
|
115
|
+
- lib/state_machines-mongoid.rb
|
116
|
+
- lib/state_machines/integrations/mongoid.rb
|
117
|
+
- lib/state_machines/integrations/mongoid/locale.rb
|
118
|
+
- lib/state_machines/integrations/mongoid/version.rb
|
119
|
+
- lib/state_machines/state_machines-mongoid.rb
|
55
120
|
- state_machines-mongoid.gemspec
|
121
|
+
- test/files/en.yml
|
122
|
+
- test/integration_test.rb
|
123
|
+
- test/machine_by_default_test.rb
|
124
|
+
- test/machine_errors_test.rb
|
125
|
+
- test/machine_multiple_test.rb
|
126
|
+
- test/machine_nested_action_test.rb
|
127
|
+
- test/machine_with_aliased_attribute_test.rb
|
128
|
+
- test/machine_with_aliased_field_test.rb
|
129
|
+
- test/machine_with_callbacks_test.rb
|
130
|
+
- test/machine_with_column_state_attribute_test.rb
|
131
|
+
- test/machine_with_complex_pluralization_scopes_test.rb
|
132
|
+
- test/machine_with_conflicting_predicate_test.rb
|
133
|
+
- test/machine_with_conflicting_state_name_test.rb
|
134
|
+
- test/machine_with_custom_attribute_test.rb
|
135
|
+
- test/machine_with_default_scope_test.rb
|
136
|
+
- test/machine_with_different_column_default_test.rb
|
137
|
+
- test/machine_with_different_integer_column_default_test.rb
|
138
|
+
- test/machine_with_different_same_default_test.rb
|
139
|
+
- test/machine_with_dirty_attribute_and_custom_attributes_during_loopback_test.rb
|
140
|
+
- test/machine_with_dirty_attribute_and_state_events_test.rb
|
141
|
+
- test/machine_with_dirty_attributes_and_custom_attribute_test.rb
|
142
|
+
- test/machine_with_dirty_attributes_during_loopback_test.rb
|
143
|
+
- test/machine_with_dirty_attributes_test.rb
|
144
|
+
- test/machine_with_dynamic_initial_state_test.rb
|
145
|
+
- test/machine_with_event_attributes_on_autosave_test.rb
|
146
|
+
- test/machine_with_event_attributes_on_custom_action_test.rb
|
147
|
+
- test/machine_with_event_attributes_on_save_bang_test.rb
|
148
|
+
- test/machine_with_event_attributes_on_save_test.rb
|
149
|
+
- test/machine_with_event_attributes_on_validation_test.rb
|
150
|
+
- test/machine_with_events_test.rb
|
151
|
+
- test/machine_with_failed_action_test.rb
|
152
|
+
- test/machine_with_failed_after_callbacks_test.rb
|
153
|
+
- test/machine_with_failed_before_callbacks_test.rb
|
154
|
+
- test/machine_with_field_test.rb
|
155
|
+
- test/machine_with_initialized_state_test.rb
|
156
|
+
- test/machine_with_internationalization_test.rb
|
157
|
+
- test/machine_with_loopback_test.rb
|
158
|
+
- test/machine_with_non_column_state_attribute_defined_test.rb
|
159
|
+
- test/machine_with_non_column_state_attribute_undefined_test.rb
|
160
|
+
- test/machine_with_scopes_and_owner_subclass_test.rb
|
161
|
+
- test/machine_with_scopes_test.rb
|
162
|
+
- test/machine_with_state_driven_validations_test.rb
|
163
|
+
- test/machine_with_state_test.rb
|
164
|
+
- test/machine_with_static_initial_state_test.rb
|
165
|
+
- test/machine_with_validations_and_custom_attribute_test.rb
|
166
|
+
- test/machine_with_validations_test.rb
|
167
|
+
- test/machine_without_field_test.rb
|
168
|
+
- test/test_helper.rb
|
56
169
|
homepage: ''
|
57
170
|
licenses:
|
58
171
|
- MIT
|
@@ -65,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
178
|
requirements:
|
66
179
|
- - ">="
|
67
180
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
181
|
+
version: 1.9.3
|
69
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
183
|
requirements:
|
71
184
|
- - ">="
|
@@ -73,9 +186,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
186
|
version: '0'
|
74
187
|
requirements: []
|
75
188
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
189
|
+
rubygems_version: 2.4.5
|
77
190
|
signing_key:
|
78
191
|
specification_version: 4
|
79
192
|
summary: Mongoid integration for state machines
|
80
|
-
test_files:
|
193
|
+
test_files:
|
194
|
+
- test/files/en.yml
|
195
|
+
- test/integration_test.rb
|
196
|
+
- test/machine_by_default_test.rb
|
197
|
+
- test/machine_errors_test.rb
|
198
|
+
- test/machine_multiple_test.rb
|
199
|
+
- test/machine_nested_action_test.rb
|
200
|
+
- test/machine_with_aliased_attribute_test.rb
|
201
|
+
- test/machine_with_aliased_field_test.rb
|
202
|
+
- test/machine_with_callbacks_test.rb
|
203
|
+
- test/machine_with_column_state_attribute_test.rb
|
204
|
+
- test/machine_with_complex_pluralization_scopes_test.rb
|
205
|
+
- test/machine_with_conflicting_predicate_test.rb
|
206
|
+
- test/machine_with_conflicting_state_name_test.rb
|
207
|
+
- test/machine_with_custom_attribute_test.rb
|
208
|
+
- test/machine_with_default_scope_test.rb
|
209
|
+
- test/machine_with_different_column_default_test.rb
|
210
|
+
- test/machine_with_different_integer_column_default_test.rb
|
211
|
+
- test/machine_with_different_same_default_test.rb
|
212
|
+
- test/machine_with_dirty_attribute_and_custom_attributes_during_loopback_test.rb
|
213
|
+
- test/machine_with_dirty_attribute_and_state_events_test.rb
|
214
|
+
- test/machine_with_dirty_attributes_and_custom_attribute_test.rb
|
215
|
+
- test/machine_with_dirty_attributes_during_loopback_test.rb
|
216
|
+
- test/machine_with_dirty_attributes_test.rb
|
217
|
+
- test/machine_with_dynamic_initial_state_test.rb
|
218
|
+
- test/machine_with_event_attributes_on_autosave_test.rb
|
219
|
+
- test/machine_with_event_attributes_on_custom_action_test.rb
|
220
|
+
- test/machine_with_event_attributes_on_save_bang_test.rb
|
221
|
+
- test/machine_with_event_attributes_on_save_test.rb
|
222
|
+
- test/machine_with_event_attributes_on_validation_test.rb
|
223
|
+
- test/machine_with_events_test.rb
|
224
|
+
- test/machine_with_failed_action_test.rb
|
225
|
+
- test/machine_with_failed_after_callbacks_test.rb
|
226
|
+
- test/machine_with_failed_before_callbacks_test.rb
|
227
|
+
- test/machine_with_field_test.rb
|
228
|
+
- test/machine_with_initialized_state_test.rb
|
229
|
+
- test/machine_with_internationalization_test.rb
|
230
|
+
- test/machine_with_loopback_test.rb
|
231
|
+
- test/machine_with_non_column_state_attribute_defined_test.rb
|
232
|
+
- test/machine_with_non_column_state_attribute_undefined_test.rb
|
233
|
+
- test/machine_with_scopes_and_owner_subclass_test.rb
|
234
|
+
- test/machine_with_scopes_test.rb
|
235
|
+
- test/machine_with_state_driven_validations_test.rb
|
236
|
+
- test/machine_with_state_test.rb
|
237
|
+
- test/machine_with_static_initial_state_test.rb
|
238
|
+
- test/machine_with_validations_and_custom_attribute_test.rb
|
239
|
+
- test/machine_with_validations_test.rb
|
240
|
+
- test/machine_without_field_test.rb
|
241
|
+
- test/test_helper.rb
|
81
242
|
has_rdoc:
|