aasm 5.1.0 → 5.2.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +0 -11
- data/Appraisals +5 -5
- data/CHANGELOG.md +17 -0
- data/README.md +78 -6
- data/aasm.gemspec +1 -1
- data/gemfiles/rails_4.2.gemfile +1 -1
- data/gemfiles/rails_4.2_mongoid_5.gemfile +1 -1
- data/gemfiles/rails_5.0.gemfile +1 -1
- data/gemfiles/rails_5.1.gemfile +1 -1
- data/gemfiles/rails_5.2.gemfile +1 -1
- data/lib/aasm/base.rb +30 -11
- data/lib/aasm/configuration.rb +3 -0
- data/lib/aasm/core/event.rb +7 -2
- data/lib/aasm/core/state.rb +6 -5
- data/lib/aasm/core/transition.rb +1 -1
- data/lib/aasm/dsl_helper.rb +24 -22
- data/lib/aasm/instance_base.rb +1 -1
- data/lib/aasm/localizer.rb +13 -3
- data/lib/aasm/persistence/active_record_persistence.rb +18 -13
- data/lib/aasm/persistence/base.rb +13 -2
- data/lib/aasm/persistence/orm.rb +1 -1
- data/lib/aasm/version.rb +1 -1
- data/lib/aasm.rb +0 -2
- data/spec/database.rb +9 -11
- data/spec/en.yml +0 -3
- data/spec/{en_deprecated_style.yml → localizer_test_model_deprecated_style.yml} +6 -3
- data/spec/localizer_test_model_new_style.yml +11 -0
- data/spec/models/active_record/localizer_test_model.rb +11 -3
- data/spec/models/active_record/namespaced.rb +16 -0
- data/spec/models/active_record/timestamp_example.rb +16 -0
- data/spec/models/default_state.rb +1 -1
- data/spec/models/mongoid/timestamp_example_mongoid.rb +20 -0
- data/spec/models/timestamps_example.rb +19 -0
- data/spec/models/timestamps_with_named_machine_example.rb +13 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/unit/api_spec.rb +4 -0
- data/spec/unit/inspection_multiple_spec.rb +9 -5
- data/spec/unit/inspection_spec.rb +7 -3
- data/spec/unit/localizer_spec.rb +49 -18
- data/spec/unit/persistence/active_record_persistence_multiple_spec.rb +17 -0
- data/spec/unit/persistence/active_record_persistence_spec.rb +12 -0
- data/spec/unit/persistence/mongoid_persistence_spec.rb +12 -0
- data/spec/unit/state_spec.rb +21 -5
- data/spec/unit/timestamps_spec.rb +32 -0
- metadata +20 -12
data/spec/database.rb
CHANGED
@@ -5,17 +5,10 @@ ActiveRecord::Migration.suppress_messages do
|
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
t.string "status"
|
13
|
-
end
|
14
|
-
ActiveRecord::Migration.create_table "implemented_abstract_class_dsls", :force => true do |t|
|
15
|
-
t.string "status"
|
16
|
-
end
|
17
|
-
ActiveRecord::Migration.create_table "users", :force => true do |t|
|
18
|
-
t.string "status"
|
8
|
+
%w(simple_new_dsls multiple_simple_new_dsls implemented_abstract_class_dsls users multiple_namespaceds).each do |table_name|
|
9
|
+
ActiveRecord::Migration.create_table table_name, :force => true do |t|
|
10
|
+
t.string "status"
|
11
|
+
end
|
19
12
|
end
|
20
13
|
|
21
14
|
ActiveRecord::Migration.create_table "complex_active_record_examples", :force => true do |t|
|
@@ -56,4 +49,9 @@ ActiveRecord::Migration.suppress_messages do
|
|
56
49
|
t.string "state"
|
57
50
|
t.string "some_string"
|
58
51
|
end
|
52
|
+
|
53
|
+
ActiveRecord::Migration.create_table "timestamp_examples", :force => true do |t|
|
54
|
+
t.string "aasm_state"
|
55
|
+
t.datetime "opened_at"
|
56
|
+
end
|
59
57
|
end
|
data/spec/en.yml
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
en:
|
2
2
|
activerecord:
|
3
|
-
|
3
|
+
attributes:
|
4
4
|
localizer_test_model:
|
5
|
-
|
5
|
+
aasm_state:
|
6
|
+
opened: "It's open now!"
|
6
7
|
|
8
|
+
fr:
|
9
|
+
activerecord:
|
7
10
|
attributes:
|
8
11
|
localizer_test_model:
|
9
12
|
aasm_state:
|
10
|
-
opened: "
|
13
|
+
opened: "C'est ouvert maintenant!"
|
@@ -11,24 +11,32 @@ end
|
|
11
11
|
|
12
12
|
describe 'localized state names' do
|
13
13
|
before(:all) do
|
14
|
-
I18n.load_path << 'spec/
|
15
|
-
I18n.default_locale = :en
|
14
|
+
I18n.load_path << 'spec/localizer_test_model_new_style.yml'
|
16
15
|
I18n.reload!
|
17
16
|
end
|
18
17
|
|
19
18
|
after(:all) do
|
20
|
-
I18n.load_path.
|
19
|
+
I18n.load_path.delete('spec/localizer_test_model_new_style.yml')
|
20
|
+
I18n.backend.load_translations
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'should localize' do
|
24
24
|
state = LocalizerTestModel.aasm.states.detect {|s| s == :opened}
|
25
25
|
expect(state.localized_name).to eq("It's open now!")
|
26
26
|
expect(state.human_name).to eq("It's open now!")
|
27
|
+
expect(state.display_name).to eq("It's open now!")
|
28
|
+
|
29
|
+
I18n.with_locale(:fr) do
|
30
|
+
expect(state.localized_name).to eq("C'est ouvert maintenant!")
|
31
|
+
expect(state.human_name).to eq("C'est ouvert maintenant!")
|
32
|
+
expect(state.display_name).to eq("C'est ouvert maintenant!")
|
33
|
+
end
|
27
34
|
end
|
28
35
|
|
29
36
|
it 'should use fallback' do
|
30
37
|
state = LocalizerTestModel.aasm.states.detect {|s| s == :closed}
|
31
38
|
expect(state.localized_name).to eq('Closed')
|
32
39
|
expect(state.human_name).to eq('Closed')
|
40
|
+
expect(state.display_name).to eq('Closed')
|
33
41
|
end
|
34
42
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class MultipleNamespaced < ActiveRecord::Base
|
2
|
+
include AASM
|
3
|
+
|
4
|
+
aasm(:status, namespace: :car) do
|
5
|
+
state :unsold, initial: true
|
6
|
+
state :sold
|
7
|
+
|
8
|
+
event :sell do
|
9
|
+
transitions from: :unsold, to: :sold
|
10
|
+
end
|
11
|
+
|
12
|
+
event :return do
|
13
|
+
transitions from: :sold, to: :unsold
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class TimestampExample < ActiveRecord::Base
|
2
|
+
include AASM
|
3
|
+
|
4
|
+
aasm column: :aasm_state, timestamps: true do
|
5
|
+
state :opened
|
6
|
+
state :closed
|
7
|
+
|
8
|
+
event :open do
|
9
|
+
transitions to: :opened
|
10
|
+
end
|
11
|
+
|
12
|
+
event :close do
|
13
|
+
transitions to: :closed
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class TimestampExampleMongoid
|
2
|
+
include Mongoid::Document
|
3
|
+
include AASM
|
4
|
+
|
5
|
+
field :status, type: String
|
6
|
+
field :opened_at, type: Time
|
7
|
+
|
8
|
+
aasm column: :status, timestamps: true do
|
9
|
+
state :opened
|
10
|
+
state :closed
|
11
|
+
|
12
|
+
event :open do
|
13
|
+
transitions to: :opened
|
14
|
+
end
|
15
|
+
|
16
|
+
event :close do
|
17
|
+
transitions to: :closed
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class TimestampsExample
|
2
|
+
include AASM
|
3
|
+
|
4
|
+
attr_accessor :opened_at
|
5
|
+
attr_reader :closed_at
|
6
|
+
|
7
|
+
aasm timestamps: true do
|
8
|
+
state :opened
|
9
|
+
state :closed
|
10
|
+
|
11
|
+
event :open do
|
12
|
+
transitions to: :opened
|
13
|
+
end
|
14
|
+
|
15
|
+
event :close do
|
16
|
+
transitions to: :closed
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -13,6 +13,7 @@ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib
|
|
13
13
|
require 'aasm'
|
14
14
|
require 'rspec'
|
15
15
|
require 'aasm/rspec'
|
16
|
+
require 'i18n'
|
16
17
|
require 'pry'
|
17
18
|
|
18
19
|
# require 'ruby-debug'; Debugger.settings[:autoeval] = true; debugger; rubys_debugger = 'annoying'
|
@@ -34,3 +35,7 @@ Dir[File.dirname(__FILE__) + "/spec_helpers/**/*.rb"].sort.each { |f| require Fi
|
|
34
35
|
|
35
36
|
# example model classes
|
36
37
|
Dir[File.dirname(__FILE__) + "/models/*.rb"].sort.each { |f| require File.expand_path(f) }
|
38
|
+
|
39
|
+
I18n.load_path << 'spec/en.yml'
|
40
|
+
I18n.enforce_available_locales = false
|
41
|
+
I18n.default_locale = :en
|
data/spec/unit/api_spec.rb
CHANGED
@@ -13,6 +13,10 @@ if defined?(ActiveRecord)
|
|
13
13
|
expect(DefaultState.new.aasm.current_state).to eql :alpha
|
14
14
|
end
|
15
15
|
|
16
|
+
it "uses display option" do
|
17
|
+
expect(DefaultState.new.aasm.human_state).to eql "ALPHA"
|
18
|
+
end
|
19
|
+
|
16
20
|
it "uses the provided method" do
|
17
21
|
expect(ProvidedState.new.aasm.current_state).to eql :beta
|
18
22
|
end
|
@@ -166,11 +166,15 @@ describe "special cases" do
|
|
166
166
|
end
|
167
167
|
|
168
168
|
describe 'aasm.states_for_select' do
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
169
|
+
context 'without I18n' do
|
170
|
+
before { allow(Module).to receive(:const_defined?).with(:I18n).and_return(nil) }
|
171
|
+
|
172
|
+
it "should return a select friendly array of states" do
|
173
|
+
expect(FooMultiple.aasm(:left)).to respond_to(:states_for_select)
|
174
|
+
expect(FooMultiple.aasm(:left).states_for_select).to eq(
|
175
|
+
[['Open', 'open'], ['Closed', 'closed'], ['Final', 'final']]
|
176
|
+
)
|
177
|
+
end
|
174
178
|
end
|
175
179
|
end
|
176
180
|
|
@@ -102,9 +102,13 @@ describe "special cases" do
|
|
102
102
|
end
|
103
103
|
|
104
104
|
describe 'aasm.states_for_select' do
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
context 'without I18n' do
|
106
|
+
before { allow(Module).to receive(:const_defined?).with(:I18n).and_return(nil) }
|
107
|
+
|
108
|
+
it "should return a select friendly array of states" do
|
109
|
+
expect(Foo.aasm).to respond_to(:states_for_select)
|
110
|
+
expect(Foo.aasm.states_for_select).to eq([['Open', 'open'], ['Closed', 'closed'], ['Final', 'final']])
|
111
|
+
end
|
108
112
|
end
|
109
113
|
end
|
110
114
|
|
data/spec/unit/localizer_spec.rb
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
if defined?(
|
4
|
-
require '
|
5
|
-
|
6
|
-
I18n.enforce_available_locales = false
|
3
|
+
if defined?(ActiveRecord)
|
4
|
+
require 'models/active_record/localizer_test_model'
|
7
5
|
load_schema
|
8
6
|
|
9
7
|
describe AASM::Localizer, "new style" do
|
10
8
|
before(:all) do
|
11
|
-
I18n.load_path << 'spec/
|
12
|
-
I18n.default_locale = :en
|
9
|
+
I18n.load_path << 'spec/localizer_test_model_new_style.yml'
|
13
10
|
I18n.reload!
|
14
11
|
end
|
15
12
|
|
16
13
|
after(:all) do
|
17
|
-
I18n.load_path.
|
14
|
+
I18n.load_path.delete('spec/localizer_test_model_new_style.yml')
|
15
|
+
I18n.backend.load_translations
|
18
16
|
end
|
19
17
|
|
20
18
|
let (:foo_opened) { LocalizerTestModel.new }
|
@@ -31,25 +29,42 @@ if defined?(ActiceRecord)
|
|
31
29
|
end
|
32
30
|
|
33
31
|
context 'aasm.human_event_name' do
|
34
|
-
|
35
|
-
|
32
|
+
context 'with event name' do
|
33
|
+
it 'should return translated event name' do
|
34
|
+
expect(LocalizerTestModel.aasm.human_event_name(:close)).to eq("Let's close it!")
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should return humanized event name' do
|
38
|
+
expect(LocalizerTestModel.aasm.human_event_name(:open)).to eq("Open")
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
|
-
|
39
|
-
|
42
|
+
context 'with event object' do
|
43
|
+
it 'should return translated event name' do
|
44
|
+
event = LocalizerTestModel.aasm.events.detect { |e| e.name == :close }
|
45
|
+
|
46
|
+
expect(LocalizerTestModel.aasm.human_event_name(event)).to eq("Let's close it!")
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should return humanized event name' do
|
50
|
+
event = LocalizerTestModel.aasm.events.detect { |e| e.name == :open }
|
51
|
+
|
52
|
+
expect(LocalizerTestModel.aasm.human_event_name(event)).to eq("Open")
|
53
|
+
end
|
40
54
|
end
|
41
55
|
end
|
42
56
|
end
|
43
57
|
|
44
58
|
describe AASM::Localizer, "deprecated style" do
|
45
59
|
before(:all) do
|
46
|
-
I18n.load_path << 'spec/
|
47
|
-
I18n.default_locale = :en
|
60
|
+
I18n.load_path << 'spec/localizer_test_model_deprecated_style.yml'
|
48
61
|
I18n.reload!
|
62
|
+
I18n.backend.load_translations
|
49
63
|
end
|
50
64
|
|
51
65
|
after(:all) do
|
52
|
-
I18n.load_path.
|
66
|
+
I18n.load_path.delete('spec/localizer_test_model_deprecated_style.yml')
|
67
|
+
I18n.backend.load_translations
|
53
68
|
end
|
54
69
|
|
55
70
|
let (:foo_opened) { LocalizerTestModel.new }
|
@@ -66,12 +81,28 @@ if defined?(ActiceRecord)
|
|
66
81
|
end
|
67
82
|
|
68
83
|
context 'aasm.human_event_name' do
|
69
|
-
|
70
|
-
|
84
|
+
context 'with event name' do
|
85
|
+
it 'should return translated event name' do
|
86
|
+
expect(LocalizerTestModel.aasm.human_event_name(:close)).to eq("Let's close it!")
|
87
|
+
end
|
88
|
+
|
89
|
+
it 'should return humanized event name' do
|
90
|
+
expect(LocalizerTestModel.aasm.human_event_name(:open)).to eq("Open")
|
91
|
+
end
|
71
92
|
end
|
72
93
|
|
73
|
-
|
74
|
-
|
94
|
+
context 'with event object' do
|
95
|
+
it 'should return translated event name' do
|
96
|
+
event = LocalizerTestModel.aasm.events.detect { |e| e.name == :close }
|
97
|
+
|
98
|
+
expect(LocalizerTestModel.aasm.human_event_name(event)).to eq("Let's close it!")
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'should return humanized event name' do
|
102
|
+
event = LocalizerTestModel.aasm.events.detect { |e| e.name == :open }
|
103
|
+
|
104
|
+
expect(LocalizerTestModel.aasm.human_event_name(event)).to eq("Open")
|
105
|
+
end
|
75
106
|
end
|
76
107
|
end
|
77
108
|
end
|
@@ -331,6 +331,23 @@ if defined?(ActiveRecord)
|
|
331
331
|
expect(MultipleSimpleNewDsl.unknown_scope).to contain_exactly(dsl2)
|
332
332
|
end
|
333
333
|
end
|
334
|
+
|
335
|
+
context "when namespeced" do
|
336
|
+
it "add namespaced scopes" do
|
337
|
+
expect(MultipleNamespaced).to respond_to(:car_unsold)
|
338
|
+
expect(MultipleNamespaced).to respond_to(:car_sold)
|
339
|
+
|
340
|
+
expect(MultipleNamespaced.car_unsold.is_a?(ActiveRecord::Relation)).to be_truthy
|
341
|
+
expect(MultipleNamespaced.car_sold.is_a?(ActiveRecord::Relation)).to be_truthy
|
342
|
+
end
|
343
|
+
it "add unnamespaced scopes" do
|
344
|
+
expect(MultipleNamespaced).to respond_to(:unsold)
|
345
|
+
expect(MultipleNamespaced).to respond_to(:sold)
|
346
|
+
|
347
|
+
expect(MultipleNamespaced.unsold.is_a?(ActiveRecord::Relation)).to be_truthy
|
348
|
+
expect(MultipleNamespaced.sold.is_a?(ActiveRecord::Relation)).to be_truthy
|
349
|
+
end
|
350
|
+
end
|
334
351
|
end # scopes
|
335
352
|
|
336
353
|
describe "direct assignment" do
|
@@ -837,4 +837,16 @@ if defined?(ActiveRecord)
|
|
837
837
|
expect(example.complete!).to be_falsey
|
838
838
|
end
|
839
839
|
end
|
840
|
+
|
841
|
+
describe 'testing the timestamps option' do
|
842
|
+
let(:example) { TimestampExample.create! }
|
843
|
+
|
844
|
+
it 'should update existing timestamp columns' do
|
845
|
+
expect { example.open! }.to change { example.reload.opened_at }.from(nil).to(instance_of(::Time))
|
846
|
+
end
|
847
|
+
|
848
|
+
it 'should not fail if there is no corresponding timestamp column' do
|
849
|
+
expect { example.close! }.to change { example.reload.aasm_state }
|
850
|
+
end
|
851
|
+
end
|
840
852
|
end
|
@@ -161,5 +161,17 @@ if defined?(Mongoid::Document)
|
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
|
+
describe 'testing the timestamps option' do
|
165
|
+
let(:example) { TimestampExampleMongoid.create }
|
166
|
+
|
167
|
+
it 'should update existing timestamp fields' do
|
168
|
+
expect { example.open! }.to change { example.reload.opened_at }.from(nil).to(instance_of(::Time))
|
169
|
+
end
|
170
|
+
|
171
|
+
it 'should not fail if there is no corresponding timestamp field' do
|
172
|
+
expect { example.close! }.to change { example.reload.status }
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
164
176
|
end
|
165
177
|
end
|
data/spec/unit/state_spec.rb
CHANGED
@@ -17,12 +17,28 @@ describe AASM::Core::State do
|
|
17
17
|
expect(state.name).to eq(:astate)
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
describe '#display_name' do
|
21
|
+
subject(:display_name) { new_state(options).display_name }
|
22
|
+
|
23
|
+
context 'without options' do
|
24
|
+
let(:options) { {} }
|
25
|
+
|
26
|
+
context 'without I18n' do
|
27
|
+
before { allow(Module).to receive(:const_defined?).with(:I18n).and_return(nil) }
|
28
|
+
|
29
|
+
it 'should set the display_name from name' do
|
30
|
+
expect(display_name).to eq('Astate')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'with :display option' do
|
36
|
+
let(:options) { { display: "A State" } }
|
23
37
|
|
24
|
-
|
25
|
-
|
38
|
+
it 'should set the display_name from options' do
|
39
|
+
expect(display_name).to eq('A State')
|
40
|
+
end
|
41
|
+
end
|
26
42
|
end
|
27
43
|
|
28
44
|
it 'should set the options and expose them as options' do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'timestamps option' do
|
4
|
+
it 'calls a timestamp setter based on the state name when entering a new state' do
|
5
|
+
object = TimestampsExample.new
|
6
|
+
expect { object.open }.to change { object.opened_at }.from(nil).to(instance_of(::Time))
|
7
|
+
end
|
8
|
+
|
9
|
+
it 'overwrites any previous timestamp if a state is entered repeatedly' do
|
10
|
+
object = TimestampsExample.new
|
11
|
+
object.opened_at = ::Time.new(2000, 1, 1)
|
12
|
+
expect { object.open }.to change { object.opened_at }
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'does nothing if there is no setter matching the new state' do
|
16
|
+
object = TimestampsExample.new
|
17
|
+
expect { object.close }.not_to change { object.closed_at }
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'can be turned off and on' do
|
21
|
+
object = TimestampsExample.new
|
22
|
+
object.class.aasm.state_machine.config.timestamps = false
|
23
|
+
expect { object.open }.not_to change { object.opened_at }
|
24
|
+
object.class.aasm.state_machine.config.timestamps = true
|
25
|
+
expect { object.open }.to change { object.opened_at }
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'calls a timestamp setter when using a named state machine' do
|
29
|
+
object = TimestampsWithNamedMachineExample.new
|
30
|
+
expect { object.open }.to change { object.opened_at }.from(nil).to(instance_of(::Time))
|
31
|
+
end
|
32
|
+
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: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thorsten Boettger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|
@@ -115,20 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - ">="
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.1.
|
119
|
-
- - "<"
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
version: 0.1.20
|
118
|
+
version: 0.1.21
|
122
119
|
type: :development
|
123
120
|
prerelease: false
|
124
121
|
version_requirements: !ruby/object:Gem::Requirement
|
125
122
|
requirements:
|
126
123
|
- - ">="
|
127
124
|
- !ruby/object:Gem::Version
|
128
|
-
version: 0.1.
|
129
|
-
- - "<"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 0.1.20
|
125
|
+
version: 0.1.21
|
132
126
|
- !ruby/object:Gem::Dependency
|
133
127
|
name: pry
|
134
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,10 +226,11 @@ files:
|
|
232
226
|
- spec/database.rb
|
233
227
|
- spec/database.yml
|
234
228
|
- spec/en.yml
|
235
|
-
- spec/en_deprecated_style.yml
|
236
229
|
- spec/generators/active_record_generator_spec.rb
|
237
230
|
- spec/generators/mongoid_generator_spec.rb
|
238
231
|
- spec/generators/no_brainer_generator_spec.rb
|
232
|
+
- spec/localizer_test_model_deprecated_style.yml
|
233
|
+
- spec/localizer_test_model_new_style.yml
|
239
234
|
- spec/models/active_record/active_record_callback.rb
|
240
235
|
- spec/models/active_record/basic_active_record_two_state_machines_example.rb
|
241
236
|
- spec/models/active_record/complex_active_record_example.rb
|
@@ -245,6 +240,7 @@ files:
|
|
245
240
|
- spec/models/active_record/instance_level_skip_validation_example.rb
|
246
241
|
- spec/models/active_record/invalid_persistor.rb
|
247
242
|
- spec/models/active_record/localizer_test_model.rb
|
243
|
+
- spec/models/active_record/namespaced.rb
|
248
244
|
- spec/models/active_record/no_direct_assignment.rb
|
249
245
|
- spec/models/active_record/no_scope.rb
|
250
246
|
- spec/models/active_record/persisted_state.rb
|
@@ -255,6 +251,7 @@ files:
|
|
255
251
|
- spec/models/active_record/silent_persistor.rb
|
256
252
|
- spec/models/active_record/simple_new_dsl.rb
|
257
253
|
- spec/models/active_record/thief.rb
|
254
|
+
- spec/models/active_record/timestamp_example.rb
|
258
255
|
- spec/models/active_record/transactor.rb
|
259
256
|
- spec/models/active_record/transient.rb
|
260
257
|
- spec/models/active_record/validator.rb
|
@@ -301,6 +298,7 @@ files:
|
|
301
298
|
- spec/models/mongoid/silent_persistor_mongoid.rb
|
302
299
|
- spec/models/mongoid/simple_mongoid.rb
|
303
300
|
- spec/models/mongoid/simple_new_dsl_mongoid.rb
|
301
|
+
- spec/models/mongoid/timestamp_example_mongoid.rb
|
304
302
|
- spec/models/mongoid/validator_mongoid.rb
|
305
303
|
- spec/models/multi_transitioner.rb
|
306
304
|
- spec/models/multiple_transitions_that_differ_only_by_guard.rb
|
@@ -342,6 +340,8 @@ files:
|
|
342
340
|
- spec/models/sub_classing.rb
|
343
341
|
- spec/models/super_class.rb
|
344
342
|
- spec/models/this_name_better_not_be_in_use.rb
|
343
|
+
- spec/models/timestamps_example.rb
|
344
|
+
- spec/models/timestamps_with_named_machine_example.rb
|
345
345
|
- spec/models/valid_state_name.rb
|
346
346
|
- spec/spec_helper.rb
|
347
347
|
- spec/spec_helpers/active_record.rb
|
@@ -406,6 +406,7 @@ files:
|
|
406
406
|
- spec/unit/states_on_one_line_example_spec.rb
|
407
407
|
- spec/unit/subclassing_multiple_spec.rb
|
408
408
|
- spec/unit/subclassing_spec.rb
|
409
|
+
- spec/unit/timestamps_spec.rb
|
409
410
|
- spec/unit/transition_spec.rb
|
410
411
|
- test/minitest_helper.rb
|
411
412
|
- test/unit/minitest_matcher_test.rb
|
@@ -436,10 +437,11 @@ test_files:
|
|
436
437
|
- spec/database.rb
|
437
438
|
- spec/database.yml
|
438
439
|
- spec/en.yml
|
439
|
-
- spec/en_deprecated_style.yml
|
440
440
|
- spec/generators/active_record_generator_spec.rb
|
441
441
|
- spec/generators/mongoid_generator_spec.rb
|
442
442
|
- spec/generators/no_brainer_generator_spec.rb
|
443
|
+
- spec/localizer_test_model_deprecated_style.yml
|
444
|
+
- spec/localizer_test_model_new_style.yml
|
443
445
|
- spec/models/active_record/active_record_callback.rb
|
444
446
|
- spec/models/active_record/basic_active_record_two_state_machines_example.rb
|
445
447
|
- spec/models/active_record/complex_active_record_example.rb
|
@@ -449,6 +451,7 @@ test_files:
|
|
449
451
|
- spec/models/active_record/instance_level_skip_validation_example.rb
|
450
452
|
- spec/models/active_record/invalid_persistor.rb
|
451
453
|
- spec/models/active_record/localizer_test_model.rb
|
454
|
+
- spec/models/active_record/namespaced.rb
|
452
455
|
- spec/models/active_record/no_direct_assignment.rb
|
453
456
|
- spec/models/active_record/no_scope.rb
|
454
457
|
- spec/models/active_record/persisted_state.rb
|
@@ -459,6 +462,7 @@ test_files:
|
|
459
462
|
- spec/models/active_record/silent_persistor.rb
|
460
463
|
- spec/models/active_record/simple_new_dsl.rb
|
461
464
|
- spec/models/active_record/thief.rb
|
465
|
+
- spec/models/active_record/timestamp_example.rb
|
462
466
|
- spec/models/active_record/transactor.rb
|
463
467
|
- spec/models/active_record/transient.rb
|
464
468
|
- spec/models/active_record/validator.rb
|
@@ -505,6 +509,7 @@ test_files:
|
|
505
509
|
- spec/models/mongoid/silent_persistor_mongoid.rb
|
506
510
|
- spec/models/mongoid/simple_mongoid.rb
|
507
511
|
- spec/models/mongoid/simple_new_dsl_mongoid.rb
|
512
|
+
- spec/models/mongoid/timestamp_example_mongoid.rb
|
508
513
|
- spec/models/mongoid/validator_mongoid.rb
|
509
514
|
- spec/models/multi_transitioner.rb
|
510
515
|
- spec/models/multiple_transitions_that_differ_only_by_guard.rb
|
@@ -546,6 +551,8 @@ test_files:
|
|
546
551
|
- spec/models/sub_classing.rb
|
547
552
|
- spec/models/super_class.rb
|
548
553
|
- spec/models/this_name_better_not_be_in_use.rb
|
554
|
+
- spec/models/timestamps_example.rb
|
555
|
+
- spec/models/timestamps_with_named_machine_example.rb
|
549
556
|
- spec/models/valid_state_name.rb
|
550
557
|
- spec/spec_helper.rb
|
551
558
|
- spec/spec_helpers/active_record.rb
|
@@ -610,6 +617,7 @@ test_files:
|
|
610
617
|
- spec/unit/states_on_one_line_example_spec.rb
|
611
618
|
- spec/unit/subclassing_multiple_spec.rb
|
612
619
|
- spec/unit/subclassing_spec.rb
|
620
|
+
- spec/unit/timestamps_spec.rb
|
613
621
|
- spec/unit/transition_spec.rb
|
614
622
|
- test/minitest_helper.rb
|
615
623
|
- test/unit/minitest_matcher_test.rb
|