state_machines-activerecord 0.8.0 → 0.9.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/LICENSE.txt +1 -1
- data/README.md +4 -4
- data/lib/state_machines/integrations/active_record/version.rb +1 -1
- data/lib/state_machines/integrations/active_record.rb +21 -71
- data/test/machine_with_event_attributes_on_autosave_test.rb +1 -1
- data/test/machine_with_event_attributes_on_validation_test.rb +3 -3
- data/test/machine_with_scopes_and_joins_test.rb +2 -1
- data/test/machine_with_state_driven_validations_test.rb +1 -1
- data/test/machine_with_static_initial_state_test.rb +2 -1
- data/test/test_helper.rb +18 -12
- metadata +11 -23
- data/.gitignore +0 -22
- data/.travis.yml +0 -19
- data/Appraisals +0 -34
- data/Gemfile +0 -6
- data/Rakefile +0 -9
- data/gemfiles/active_record_5.1.gemfile +0 -14
- data/gemfiles/active_record_5.2.gemfile +0 -14
- data/gemfiles/active_record_6.0.gemfile +0 -14
- data/gemfiles/active_record_6.1.gemfile +0 -14
- data/gemfiles/active_record_edge.gemfile +0 -14
- data/log/.gitkeep +0 -0
- data/state_machines-activerecord.gemspec +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 570d0e44cce8dade9ceb135c6e24cfcafb7dc0325ee8f40d99658d663072e234
|
4
|
+
data.tar.gz: 2195bc14693c748c3248c3ddd42bc0a26faccbdf78285c6d24f17e54bd3ec0fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dde59866fccfe87fbd05658fd0f0b5d92c2129ff3e448c75983722e7a5468cc3201f63dfb319442a60e536e4774ecfd61429d0e979e454abba568e10a1b7cc15
|
7
|
+
data.tar.gz: f78734f5c798ae8f468d69d22e1983b95839dcf724e6b7c1e6563f81a3f1976930b6ff52d275163feaccd0419888a9d754f47d587a112df019a9c9804f21bd31
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,7 @@ For the complete usage guide, see http://www.rubydoc.info/github/state-machines/
|
|
27
27
|
### Example
|
28
28
|
|
29
29
|
```ruby
|
30
|
-
class Vehicle <
|
30
|
+
class Vehicle < ApplicationRecord
|
31
31
|
state_machine :initial => :parked do
|
32
32
|
before_transition :parked => any - :parked, :do => :put_on_seatbelt
|
33
33
|
after_transition any => :parked do |vehicle, transition|
|
@@ -40,7 +40,7 @@ class Vehicle < ActiveRecord::Base
|
|
40
40
|
end
|
41
41
|
|
42
42
|
state :first_gear, :second_gear do
|
43
|
-
|
43
|
+
validates :seatbelt_on, presence: true
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -73,7 +73,7 @@ framework, custom validators will not work as expected when defined to run
|
|
73
73
|
in multiple states. For example:
|
74
74
|
|
75
75
|
```ruby
|
76
|
-
class Vehicle <
|
76
|
+
class Vehicle < ApplicationRecord
|
77
77
|
state_machine do
|
78
78
|
state :first_gear, :second_gear do
|
79
79
|
validate :speed_is_legal
|
@@ -87,7 +87,7 @@ for the <tt>:second_gear</tt> state. To avoid this, you can define your
|
|
87
87
|
custom validation like so:
|
88
88
|
|
89
89
|
```ruby
|
90
|
-
class Vehicle <
|
90
|
+
class Vehicle < ApplicationRecord
|
91
91
|
state_machine do
|
92
92
|
state :first_gear, :second_gear do
|
93
93
|
validate {|vehicle| vehicle.speed_is_legal}
|
@@ -11,7 +11,7 @@ module StateMachines
|
|
11
11
|
# Below is an example of a simple state machine defined within an
|
12
12
|
# ActiveRecord model:
|
13
13
|
#
|
14
|
-
# class Vehicle <
|
14
|
+
# class Vehicle < ApplicationRecord
|
15
15
|
# state_machine :initial => :parked do
|
16
16
|
# event :ignite do
|
17
17
|
# transition :parked => :idling
|
@@ -82,7 +82,7 @@ module StateMachines
|
|
82
82
|
# users from tampering with events through URLs / forms, the attribute
|
83
83
|
# should be protected like so:
|
84
84
|
#
|
85
|
-
# class Vehicle <
|
85
|
+
# class Vehicle < ApplicationRecord
|
86
86
|
# attr_protected :state_event
|
87
87
|
# # attr_accessible ... # Alternative technique
|
88
88
|
#
|
@@ -94,7 +94,7 @@ module StateMachines
|
|
94
94
|
# If you want to only have *some* events be able to fire via mass-assignment,
|
95
95
|
# you can build two state machines (one public and one protected) like so:
|
96
96
|
#
|
97
|
-
# class Vehicle <
|
97
|
+
# class Vehicle < ApplicationRecord
|
98
98
|
# attr_protected :state_event # Prevent access to events in the first machine
|
99
99
|
#
|
100
100
|
# state_machine do
|
@@ -115,7 +115,7 @@ module StateMachines
|
|
115
115
|
#
|
116
116
|
# For example,
|
117
117
|
#
|
118
|
-
# class Message <
|
118
|
+
# class Message < ApplicationRecord
|
119
119
|
# end
|
120
120
|
#
|
121
121
|
# Vehicle.state_machine do
|
@@ -136,7 +136,7 @@ module StateMachines
|
|
136
136
|
#
|
137
137
|
# To turn off transactions:
|
138
138
|
#
|
139
|
-
# class Vehicle <
|
139
|
+
# class Vehicle < ApplicationRecord
|
140
140
|
# state_machine :initial => :parked, :use_transactions => false do
|
141
141
|
# ...
|
142
142
|
# end
|
@@ -150,7 +150,7 @@ module StateMachines
|
|
150
150
|
# framework, custom validators will not work as expected when defined to run
|
151
151
|
# in multiple states. For example:
|
152
152
|
#
|
153
|
-
# class Vehicle <
|
153
|
+
# class Vehicle < ApplicationRecord
|
154
154
|
# state_machine do
|
155
155
|
# ...
|
156
156
|
# state :first_gear, :second_gear do
|
@@ -163,7 +163,7 @@ module StateMachines
|
|
163
163
|
# for the <tt>:second_gear</tt> state. To avoid this, you can define your
|
164
164
|
# custom validation like so:
|
165
165
|
#
|
166
|
-
# class Vehicle <
|
166
|
+
# class Vehicle < ApplicationRecord
|
167
167
|
# state_machine do
|
168
168
|
# ...
|
169
169
|
# state :first_gear, :second_gear do
|
@@ -206,8 +206,7 @@ module StateMachines
|
|
206
206
|
# These named scopes are essentially the functional equivalent of the
|
207
207
|
# following definitions:
|
208
208
|
#
|
209
|
-
# class Vehicle <
|
210
|
-
# named_scope :with_states, lambda {|*states| {:conditions => {:state => states}}}
|
209
|
+
# class Vehicle < ApplicationRecord
|
211
210
|
# # with_states also aliased to with_state
|
212
211
|
#
|
213
212
|
# named_scope :without_states, lambda {|*states| {:conditions => ['state NOT IN (?)', states]}}
|
@@ -235,7 +234,7 @@ module StateMachines
|
|
235
234
|
#
|
236
235
|
# For example,
|
237
236
|
#
|
238
|
-
# class Vehicle <
|
237
|
+
# class Vehicle < ApplicationRecord
|
239
238
|
# state_machine :initial => :parked do
|
240
239
|
# before_transition any => :idling do |vehicle|
|
241
240
|
# vehicle.put_on_seatbelt
|
@@ -266,11 +265,11 @@ module StateMachines
|
|
266
265
|
# ActiveRecord, a save failure will cause any records that get created in
|
267
266
|
# your callback to roll back. You can work around this issue like so:
|
268
267
|
#
|
269
|
-
# class TransitionLog <
|
268
|
+
# class TransitionLog < ApplicationRecord
|
270
269
|
# establish_connection Rails.env.to_sym
|
271
270
|
# end
|
272
271
|
#
|
273
|
-
# class Vehicle <
|
272
|
+
# class Vehicle < ApplicationRecord
|
274
273
|
# state_machine do
|
275
274
|
# after_failure do |vehicle, transition|
|
276
275
|
# TransitionLog.create(:vehicle => vehicle, :transition => transition)
|
@@ -435,72 +434,23 @@ module StateMachines
|
|
435
434
|
end
|
436
435
|
|
437
436
|
# Gets the db default for the machine's attribute
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
owner_class.column_defaults[attribute.to_s]
|
442
|
-
end
|
443
|
-
end
|
444
|
-
else
|
445
|
-
def owner_class_attribute_default
|
446
|
-
if owner_class.connected? && owner_class.table_exists?
|
447
|
-
if column = owner_class.columns_hash[attribute.to_s]
|
448
|
-
column.default
|
449
|
-
end
|
450
|
-
end
|
437
|
+
def owner_class_attribute_default
|
438
|
+
if owner_class.connected? && owner_class.table_exists?
|
439
|
+
owner_class.column_defaults[attribute.to_s]
|
451
440
|
end
|
452
441
|
end
|
453
442
|
|
454
443
|
def define_state_initializer
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
super(attributes) do |*args|
|
459
|
-
scoped_attributes = (attributes || {}).merge(self.class.scope_attributes)
|
460
|
-
|
461
|
-
self.class.state_machines.initialize_states(self, {}, scoped_attributes)
|
462
|
-
yield(*args) if block_given?
|
463
|
-
end
|
464
|
-
end
|
465
|
-
end_eval
|
466
|
-
elsif ::ActiveRecord.gem_version >= Gem::Version.new('4.2')
|
467
|
-
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
|
468
|
-
def initialize(attributes = nil, options = {})
|
469
|
-
scoped_attributes = (attributes || {}).merge(self.class.scope_attributes)
|
470
|
-
|
471
|
-
super(attributes, options) do |*args|
|
472
|
-
self.class.state_machines.initialize_states(self, {}, scoped_attributes)
|
473
|
-
yield(*args) if block_given?
|
474
|
-
end
|
475
|
-
end
|
476
|
-
end_eval
|
477
|
-
else
|
478
|
-
# Initializes static states
|
479
|
-
#
|
480
|
-
# This is the only available hook where the default set of attributes
|
481
|
-
# can be overridden for a new object *prior* to the processing of the
|
482
|
-
# attributes passed into #initialize
|
483
|
-
define_helper :class, <<-end_eval, __FILE__, __LINE__ + 1
|
484
|
-
def column_defaults(*) #:nodoc:
|
485
|
-
result = super
|
486
|
-
# No need to pass in an object, since the overrides will be forced
|
487
|
-
self.state_machines.initialize_states(nil, :static => :force, :dynamic => false, :to => result)
|
488
|
-
result
|
489
|
-
end
|
490
|
-
end_eval
|
491
|
-
|
492
|
-
# Initializes dynamic states
|
493
|
-
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
|
494
|
-
def initialize(attributes = nil, options = {})
|
444
|
+
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
|
445
|
+
def initialize(attributes = nil, *)
|
446
|
+
super(attributes) do |*args|
|
495
447
|
scoped_attributes = (attributes || {}).merge(self.class.scope_attributes)
|
496
448
|
|
497
|
-
|
498
|
-
|
499
|
-
yield(*args) if block_given?
|
500
|
-
end
|
449
|
+
self.class.state_machines.initialize_states(self, {}, scoped_attributes)
|
450
|
+
yield(*args) if block_given?
|
501
451
|
end
|
502
|
-
|
503
|
-
|
452
|
+
end
|
453
|
+
end_eval
|
504
454
|
end
|
505
455
|
|
506
456
|
# Uses around callbacks to run state events if using the :save hook
|
@@ -65,7 +65,7 @@ class MachineWithEventAttributesOnValidationTest < BaseTestCase
|
|
65
65
|
def test_should_not_run_after_callbacks_with_failures_disabled_if_validation_fails
|
66
66
|
@model.class_eval do
|
67
67
|
attr_accessor :seatbelt
|
68
|
-
|
68
|
+
validates :seatbelt, presence: true
|
69
69
|
end
|
70
70
|
|
71
71
|
ran_callback = false
|
@@ -78,7 +78,7 @@ class MachineWithEventAttributesOnValidationTest < BaseTestCase
|
|
78
78
|
def test_should_run_after_callbacks_if_validation_fails
|
79
79
|
@model.class_eval do
|
80
80
|
attr_accessor :seatbelt
|
81
|
-
|
81
|
+
validates :seatbelt, presence: true
|
82
82
|
end
|
83
83
|
|
84
84
|
ran_callback = false
|
@@ -103,7 +103,7 @@ class MachineWithEventAttributesOnValidationTest < BaseTestCase
|
|
103
103
|
def test_should_not_run_around_callbacks_after_yield_with_failures_disabled_if_validation_fails
|
104
104
|
@model.class_eval do
|
105
105
|
attr_accessor :seatbelt
|
106
|
-
|
106
|
+
validates :seatbelt, presence: true
|
107
107
|
end
|
108
108
|
|
109
109
|
ran_callback = false
|
@@ -8,7 +8,7 @@ class MachineWithStateDrivenValidationsTest < BaseTestCase
|
|
8
8
|
|
9
9
|
@machine = StateMachines::Machine.new(@model)
|
10
10
|
@machine.state :first_gear, :second_gear do
|
11
|
-
|
11
|
+
validates :seatbelt, presence: true
|
12
12
|
end
|
13
13
|
@machine.other_states :parked
|
14
14
|
end
|
@@ -159,7 +159,8 @@ class MachineWithStaticInitialStateTest < BaseTestCase
|
|
159
159
|
remove_const('Owner') if defined?(MachineWithStaticInitialStateTest::Owner)
|
160
160
|
remove_const('Driver') if defined?(MachineWithStaticInitialStateTest::Driver)
|
161
161
|
end
|
162
|
-
|
162
|
+
|
163
|
+
clear_active_support_dependencies
|
163
164
|
super
|
164
165
|
end
|
165
166
|
end
|
data/test/test_helper.rb
CHANGED
@@ -11,13 +11,7 @@ require 'securerandom'
|
|
11
11
|
# Establish database connection
|
12
12
|
ActiveRecord::Base.establish_connection('adapter' => 'sqlite3', 'database' => ':memory:')
|
13
13
|
ActiveRecord::Base.logger = Logger.new("#{File.dirname(__FILE__)}/../log/active_record.log")
|
14
|
-
|
15
|
-
if ActiveSupport.gem_version >= Gem::Version.new('4.2.0')
|
16
|
-
ActiveSupport.test_order = :random
|
17
|
-
if ActiveSupport.gem_version < Gem::Version.new('5.1.x')
|
18
|
-
ActiveRecord::Base.raise_in_transactional_callbacks = true
|
19
|
-
end
|
20
|
-
end
|
14
|
+
ActiveSupport.test_order = :random
|
21
15
|
|
22
16
|
class BaseTestCase < ActiveSupport::TestCase
|
23
17
|
protected
|
@@ -31,11 +25,7 @@ class BaseTestCase < ActiveSupport::TestCase
|
|
31
25
|
connection.create_table(table_name, :force => true) { |t| t.string(:state) } if create_table
|
32
26
|
|
33
27
|
define_method(:abort_from_callback) do
|
34
|
-
|
35
|
-
throw :abort
|
36
|
-
else
|
37
|
-
false
|
38
|
-
end
|
28
|
+
throw :abort
|
39
29
|
end
|
40
30
|
|
41
31
|
(
|
@@ -49,4 +39,20 @@ class BaseTestCase < ActiveSupport::TestCase
|
|
49
39
|
model.reset_column_information if create_table
|
50
40
|
model
|
51
41
|
end
|
42
|
+
|
43
|
+
def clear_active_support_dependencies
|
44
|
+
return unless defined?(ActiveSupport::Dependencies)
|
45
|
+
|
46
|
+
if ActiveSupport::Dependencies.respond_to?(:autoloader=)
|
47
|
+
ActiveSupport::Dependencies.autoloader ||= stubbed_autoloader
|
48
|
+
end
|
49
|
+
|
50
|
+
ActiveSupport::Dependencies.clear
|
51
|
+
end
|
52
|
+
|
53
|
+
def stubbed_autoloader
|
54
|
+
Object.new.tap do |obj|
|
55
|
+
obj.define_singleton_method(:reload) {}
|
56
|
+
end
|
57
|
+
end
|
52
58
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: state_machines-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
8
|
- Aaron Pfeifer
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: state_machines-activemodel
|
@@ -17,28 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.9.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.9.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activerecord
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
34
|
+
version: '6.0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '
|
41
|
+
version: '6.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,24 +117,12 @@ executables: []
|
|
117
117
|
extensions: []
|
118
118
|
extra_rdoc_files: []
|
119
119
|
files:
|
120
|
-
- ".gitignore"
|
121
|
-
- ".travis.yml"
|
122
|
-
- Appraisals
|
123
|
-
- Gemfile
|
124
120
|
- LICENSE.txt
|
125
121
|
- README.md
|
126
|
-
- Rakefile
|
127
|
-
- gemfiles/active_record_5.1.gemfile
|
128
|
-
- gemfiles/active_record_5.2.gemfile
|
129
|
-
- gemfiles/active_record_6.0.gemfile
|
130
|
-
- gemfiles/active_record_6.1.gemfile
|
131
|
-
- gemfiles/active_record_edge.gemfile
|
132
122
|
- lib/state_machines-activerecord.rb
|
133
123
|
- lib/state_machines/integrations/active_record.rb
|
134
124
|
- lib/state_machines/integrations/active_record/locale.rb
|
135
125
|
- lib/state_machines/integrations/active_record/version.rb
|
136
|
-
- log/.gitkeep
|
137
|
-
- state_machines-activerecord.gemspec
|
138
126
|
- test/files/en.yml
|
139
127
|
- test/files/models/post.rb
|
140
128
|
- test/integration_test.rb
|
@@ -191,7 +179,7 @@ homepage: https://github.com/state-machines/state_machines-activerecord/
|
|
191
179
|
licenses:
|
192
180
|
- MIT
|
193
181
|
metadata: {}
|
194
|
-
post_install_message:
|
182
|
+
post_install_message:
|
195
183
|
rdoc_options: []
|
196
184
|
require_paths:
|
197
185
|
- lib
|
@@ -199,15 +187,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
199
187
|
requirements:
|
200
188
|
- - ">="
|
201
189
|
- !ruby/object:Gem::Version
|
202
|
-
version:
|
190
|
+
version: '3.0'
|
203
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
192
|
requirements:
|
205
193
|
- - ">="
|
206
194
|
- !ruby/object:Gem::Version
|
207
195
|
version: '0'
|
208
196
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
210
|
-
signing_key:
|
197
|
+
rubygems_version: 3.4.10
|
198
|
+
signing_key:
|
211
199
|
specification_version: 4
|
212
200
|
summary: State machines Active Record Integration
|
213
201
|
test_files:
|
data/.gitignore
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
tmp
|
16
|
-
*.bundle
|
17
|
-
*.so
|
18
|
-
*.o
|
19
|
-
*.a
|
20
|
-
log/active_record.log
|
21
|
-
.idea/
|
22
|
-
*.lock
|
data/.travis.yml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
|
4
|
-
rvm:
|
5
|
-
- 2.5.8
|
6
|
-
- 2.6.6
|
7
|
-
- 2.7.2
|
8
|
-
- jruby
|
9
|
-
|
10
|
-
gemfile:
|
11
|
-
- gemfiles/active_record_5.1.gemfile
|
12
|
-
- gemfiles/active_record_5.2.gemfile
|
13
|
-
- gemfiles/active_record_6.0.gemfile
|
14
|
-
- gemfiles/active_record_6.1.gemfile
|
15
|
-
- gemfiles/active_record_edge.gemfile
|
16
|
-
|
17
|
-
matrix:
|
18
|
-
allow_failures:
|
19
|
-
- rvm: jruby
|
data/Appraisals
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
appraise "active_record_5.1" do
|
2
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
3
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
4
|
-
gem "activerecord", github: 'rails/rails', branch: '5-1-stable'
|
5
|
-
gem "activemodel", github: 'rails/rails', branch: '5-1-stable'
|
6
|
-
end
|
7
|
-
|
8
|
-
appraise "active_record_5.2" do
|
9
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
10
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
11
|
-
gem "activerecord", github: 'rails/rails', branch: '5-2-stable'
|
12
|
-
gem "activemodel", github: 'rails/rails', branch: '5-2-stable'
|
13
|
-
end
|
14
|
-
|
15
|
-
appraise 'active_record_6.0' do
|
16
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
17
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
18
|
-
gem "activerecord", github: 'rails/rails', branch: '6-0-stable'
|
19
|
-
gem "activemodel", github: 'rails/rails', branch: '6-0-stable'
|
20
|
-
end
|
21
|
-
|
22
|
-
appraise 'active_record_6.1' do
|
23
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
24
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
25
|
-
gem "activerecord", github: 'rails/rails', branch: '6-1-stable'
|
26
|
-
gem "activemodel", github: 'rails/rails', branch: '6-1-stable'
|
27
|
-
end
|
28
|
-
|
29
|
-
appraise "active_record_edge" do
|
30
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
31
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
32
|
-
gem "activerecord", github: 'rails/rails', branch: 'master'
|
33
|
-
gem "activemodel", github: 'rails/rails', branch: 'master'
|
34
|
-
end
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
7
|
-
gem "activerecord", github: "rails/rails", branch: "5-1-stable"
|
8
|
-
gem "activemodel", github: "rails/rails", branch: "5-1-stable"
|
9
|
-
|
10
|
-
platforms :mri do
|
11
|
-
gem "pry-byebug"
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: "../"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
7
|
-
gem "activerecord", github: "rails/rails", branch: "5-2-stable"
|
8
|
-
gem "activemodel", github: "rails/rails", branch: "5-2-stable"
|
9
|
-
|
10
|
-
platforms :mri do
|
11
|
-
gem "pry-byebug"
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: "../"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
7
|
-
gem "activerecord", github: "rails/rails", branch: "6-0-stable"
|
8
|
-
gem "activemodel", github: "rails/rails", branch: "6-0-stable"
|
9
|
-
|
10
|
-
platforms :mri do
|
11
|
-
gem "pry-byebug"
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: "../"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
7
|
-
gem "activerecord", github: "rails/rails", branch: "6-1-stable"
|
8
|
-
gem "activemodel", github: "rails/rails", branch: "6-1-stable"
|
9
|
-
|
10
|
-
platforms :mri do
|
11
|
-
gem "pry-byebug"
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: "../"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "sqlite3", platforms: [:mri, :rbx]
|
6
|
-
gem "activerecord-jdbcsqlite3-adapter", platform: :jruby
|
7
|
-
gem "activerecord", github: "rails/rails", branch: "master"
|
8
|
-
gem "activemodel", github: "rails/rails", branch: "master"
|
9
|
-
|
10
|
-
platforms :mri do
|
11
|
-
gem "pry-byebug"
|
12
|
-
end
|
13
|
-
|
14
|
-
gemspec path: "../"
|
data/log/.gitkeep
DELETED
File without changes
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'state_machines/integrations/active_record/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'state_machines-activerecord'
|
8
|
-
spec.version = StateMachines::Integrations::ActiveRecord::VERSION
|
9
|
-
spec.authors = ['Abdelkader Boudih', 'Aaron Pfeifer']
|
10
|
-
spec.email = %w(terminale@gmail.com aaron@pluginaweek.org)
|
11
|
-
spec.summary = %q(State machines Active Record Integration)
|
12
|
-
spec.description = %q(Adds support for creating state machines for attributes on ActiveRecord)
|
13
|
-
spec.homepage = 'https://github.com/state-machines/state_machines-activerecord/'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.test_files = spec.files.grep(/^test\//)
|
18
|
-
spec.required_ruby_version = '>= 2.2.2'
|
19
|
-
spec.require_paths = ['lib']
|
20
|
-
|
21
|
-
spec.add_dependency 'state_machines-activemodel', '>= 0.8.0'
|
22
|
-
spec.add_dependency 'activerecord' , '>= 5.1'
|
23
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
24
|
-
spec.add_development_dependency 'sqlite3', '~> 1.3'
|
25
|
-
spec.add_development_dependency 'appraisal', '>= 1'
|
26
|
-
spec.add_development_dependency 'minitest' , '>= 5.4.0'
|
27
|
-
spec.add_development_dependency 'minitest-reporters'
|
28
|
-
end
|