statesman 7.4.0 → 12.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +7 -0
  3. data/.github/workflows/tests.yml +112 -0
  4. data/.gitignore +65 -15
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +14 -1
  7. data/.rubocop_todo.yml +37 -28
  8. data/.ruby-version +1 -0
  9. data/CHANGELOG.md +262 -41
  10. data/CONTRIBUTING.md +23 -4
  11. data/Gemfile +4 -6
  12. data/README.md +243 -43
  13. data/docs/COMPATIBILITY.md +2 -2
  14. data/lib/generators/statesman/active_record_transition_generator.rb +1 -1
  15. data/lib/generators/statesman/generator_helpers.rb +12 -4
  16. data/lib/statesman/adapters/active_record.rb +84 -55
  17. data/lib/statesman/adapters/active_record_queries.rb +19 -7
  18. data/lib/statesman/adapters/active_record_transition.rb +5 -1
  19. data/lib/statesman/adapters/memory.rb +5 -1
  20. data/lib/statesman/adapters/type_safe_active_record_queries.rb +21 -0
  21. data/lib/statesman/callback.rb +2 -2
  22. data/lib/statesman/config.rb +3 -10
  23. data/lib/statesman/exceptions.rb +13 -7
  24. data/lib/statesman/guard.rb +1 -1
  25. data/lib/statesman/machine.rb +68 -0
  26. data/lib/statesman/version.rb +1 -1
  27. data/lib/statesman.rb +5 -5
  28. data/lib/tasks/statesman.rake +5 -5
  29. data/spec/generators/statesman/active_record_transition_generator_spec.rb +7 -1
  30. data/spec/generators/statesman/migration_generator_spec.rb +5 -1
  31. data/spec/spec_helper.rb +44 -7
  32. data/spec/statesman/adapters/active_record_queries_spec.rb +34 -12
  33. data/spec/statesman/adapters/active_record_spec.rb +176 -51
  34. data/spec/statesman/adapters/active_record_transition_spec.rb +5 -2
  35. data/spec/statesman/adapters/memory_spec.rb +0 -1
  36. data/spec/statesman/adapters/memory_transition_spec.rb +0 -1
  37. data/spec/statesman/adapters/shared_examples.rb +3 -4
  38. data/spec/statesman/adapters/type_safe_active_record_queries_spec.rb +206 -0
  39. data/spec/statesman/callback_spec.rb +0 -2
  40. data/spec/statesman/config_spec.rb +0 -2
  41. data/spec/statesman/exceptions_spec.rb +17 -4
  42. data/spec/statesman/guard_spec.rb +0 -2
  43. data/spec/statesman/machine_spec.rb +252 -15
  44. data/spec/statesman/utils_spec.rb +0 -2
  45. data/spec/support/active_record.rb +156 -24
  46. data/spec/support/exactly_query_databases.rb +35 -0
  47. data/statesman.gemspec +9 -10
  48. metadata +32 -59
  49. data/.circleci/config.yml +0 -187
@@ -20,10 +20,21 @@ class MyStateMachine
20
20
  transition from: :failed, to: :initial
21
21
  end
22
22
 
23
+ class MyActiveRecordModelTransition < ActiveRecord::Base
24
+ include Statesman::Adapters::ActiveRecordTransition
25
+
26
+ belongs_to :my_active_record_model
27
+ end
28
+
23
29
  class MyActiveRecordModel < ActiveRecord::Base
24
30
  has_many :my_active_record_model_transitions, autosave: false
25
31
  alias_method :transitions, :my_active_record_model_transitions
26
32
 
33
+ include Statesman::Adapters::ActiveRecordQueries[
34
+ transition_class: MyActiveRecordModelTransition,
35
+ initial_state: :initial
36
+ ]
37
+
27
38
  def state_machine
28
39
  @state_machine ||= MyStateMachine.new(
29
40
  self, transition_class: MyActiveRecordModelTransition
@@ -35,18 +46,15 @@ class MyActiveRecordModel < ActiveRecord::Base
35
46
  end
36
47
  end
37
48
 
38
- class MyActiveRecordModelTransition < ActiveRecord::Base
39
- include Statesman::Adapters::ActiveRecordTransition
40
-
41
- belongs_to :my_active_record_model
42
- serialize :metadata, JSON
43
- end
44
-
45
49
  class MyActiveRecordModelTransitionWithoutInclude < ActiveRecord::Base
46
50
  self.table_name = "my_active_record_model_transitions"
47
51
 
48
52
  belongs_to :my_active_record_model
49
- serialize :metadata, JSON
53
+ if ::ActiveRecord.gem_version >= Gem::Version.new("7.1")
54
+ serialize :metadata, coder: JSON
55
+ else
56
+ serialize :metadata, JSON
57
+ end
50
58
  end
51
59
 
52
60
  class CreateMyActiveRecordModelMigration < MIGRATION_CLASS
@@ -59,7 +67,6 @@ class CreateMyActiveRecordModelMigration < MIGRATION_CLASS
59
67
  end
60
68
 
61
69
  # TODO: make this a module we can extend from the app? Or a generator?
62
- # rubocop:disable MethodLength, Metrics/AbcSize
63
70
  class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
64
71
  def change
65
72
  create_table :my_active_record_model_transitions do |t|
@@ -74,7 +81,7 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
74
81
  t.text :metadata, default: "{}"
75
82
  end
76
83
 
77
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
84
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
78
85
  t.boolean :most_recent, default: true, null: false
79
86
  else
80
87
  t.boolean :most_recent, default: true
@@ -91,7 +98,7 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
91
98
  %i[my_active_record_model_id sort_key],
92
99
  unique: true, name: "sort_key_index"
93
100
 
94
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
101
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
95
102
  add_index :my_active_record_model_transitions,
96
103
  %i[my_active_record_model_id most_recent],
97
104
  unique: true,
@@ -105,7 +112,6 @@ class CreateMyActiveRecordModelTransitionMigration < MIGRATION_CLASS
105
112
  end
106
113
  end
107
114
  end
108
- # rubocop:enable MethodLength, Metrics/AbcSize
109
115
 
110
116
  class OtherActiveRecordModel < ActiveRecord::Base
111
117
  has_many :other_active_record_model_transitions, autosave: false
@@ -126,7 +132,48 @@ class OtherActiveRecordModelTransition < ActiveRecord::Base
126
132
  include Statesman::Adapters::ActiveRecordTransition
127
133
 
128
134
  belongs_to :other_active_record_model
129
- serialize :metadata, JSON
135
+ end
136
+
137
+ class SecondaryRecord < ActiveRecord::Base
138
+ self.abstract_class = true
139
+
140
+ connects_to database: { writing: :secondary, reading: :secondary }
141
+ end
142
+
143
+ class SecondaryActiveRecordModelTransition < SecondaryRecord
144
+ self.table_name = "my_active_record_model_transitions"
145
+
146
+ include Statesman::Adapters::ActiveRecordTransition
147
+
148
+ belongs_to :my_active_record_model,
149
+ class_name: "SecondaryActiveRecordModel",
150
+ foreign_key: "my_active_record_model_transition_id"
151
+ end
152
+
153
+ class SecondaryActiveRecordModel < SecondaryRecord
154
+ self.table_name = "my_active_record_models"
155
+
156
+ has_many :my_active_record_model_transitions,
157
+ class_name: "SecondaryActiveRecordModelTransition",
158
+ foreign_key: "my_active_record_model_id",
159
+ autosave: false
160
+
161
+ alias_method :transitions, :my_active_record_model_transitions
162
+
163
+ include Statesman::Adapters::ActiveRecordQueries[
164
+ transition_class: SecondaryActiveRecordModelTransition,
165
+ initial_state: :initial
166
+ ]
167
+
168
+ def state_machine
169
+ @state_machine ||= MyStateMachine.new(
170
+ self, transition_class: SecondaryActiveRecordModelTransition
171
+ )
172
+ end
173
+
174
+ def metadata
175
+ super || {}
176
+ end
130
177
  end
131
178
 
132
179
  class CreateOtherActiveRecordModelMigration < MIGRATION_CLASS
@@ -139,7 +186,6 @@ class CreateOtherActiveRecordModelMigration < MIGRATION_CLASS
139
186
  end
140
187
  end
141
188
 
142
- # rubocop:disable MethodLength
143
189
  class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
144
190
  def change
145
191
  create_table :other_active_record_model_transitions do |t|
@@ -154,7 +200,7 @@ class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
154
200
  t.text :metadata, default: "{}"
155
201
  end
156
202
 
157
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
203
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
158
204
  t.boolean :most_recent, default: true, null: false
159
205
  else
160
206
  t.boolean :most_recent, default: true
@@ -167,23 +213,22 @@ class CreateOtherActiveRecordModelTransitionMigration < MIGRATION_CLASS
167
213
  %i[other_active_record_model_id sort_key],
168
214
  unique: true, name: "other_sort_key_index"
169
215
 
170
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
216
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
171
217
  add_index :other_active_record_model_transitions,
172
218
  %i[other_active_record_model_id most_recent],
173
219
  unique: true,
174
220
  where: "most_recent",
175
- name: "index_other_active_record_model_transitions_"\
221
+ name: "index_other_active_record_model_transitions_" \
176
222
  "parent_latest"
177
223
  else
178
224
  add_index :other_active_record_model_transitions,
179
225
  %i[other_active_record_model_id most_recent],
180
226
  unique: true,
181
- name: "index_other_active_record_model_transitions_"\
227
+ name: "index_other_active_record_model_transitions_" \
182
228
  "parent_latest"
183
229
  end
184
230
  end
185
231
  end
186
- # rubocop:enable MethodLength
187
232
 
188
233
  class DropMostRecentColumn < MIGRATION_CLASS
189
234
  def change
@@ -220,7 +265,6 @@ module MyNamespace
220
265
 
221
266
  belongs_to :my_active_record_model,
222
267
  class_name: "MyNamespace::MyActiveRecordModel"
223
- serialize :metadata, JSON
224
268
 
225
269
  def self.table_name_prefix
226
270
  "my_namespace_"
@@ -237,7 +281,6 @@ class CreateNamespacedARModelMigration < MIGRATION_CLASS
237
281
  end
238
282
  end
239
283
 
240
- # rubocop:disable MethodLength
241
284
  class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
242
285
  def change
243
286
  create_table :my_namespace_my_active_record_model_transitions do |t|
@@ -252,7 +295,7 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
252
295
  t.text :metadata, default: "{}"
253
296
  end
254
297
 
255
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
298
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
256
299
  t.boolean :most_recent, default: true, null: false
257
300
  else
258
301
  t.boolean :most_recent, default: true
@@ -264,7 +307,7 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
264
307
  add_index :my_namespace_my_active_record_model_transitions, :sort_key,
265
308
  unique: true, name: "my_namespaced_key"
266
309
 
267
- if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?
310
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
268
311
  add_index :my_namespace_my_active_record_model_transitions,
269
312
  %i[my_active_record_model_id most_recent],
270
313
  unique: true,
@@ -277,5 +320,94 @@ class CreateNamespacedARModelTransitionMigration < MIGRATION_CLASS
277
320
  name: "index_namespace_model_transitions_parent_latest"
278
321
  end
279
322
  end
280
- # rubocop:enable MethodLength
323
+ end
324
+
325
+ class StiActiveRecordModel < ActiveRecord::Base
326
+ has_many :sti_a_active_record_model_transitions, autosave: false
327
+ has_many :sti_b_active_record_model_transitions, autosave: false
328
+
329
+ def state_machine_a
330
+ @state_machine_a ||= MyStateMachine.new(
331
+ self, transition_class: StiAActiveRecordModelTransition
332
+ )
333
+ end
334
+
335
+ def state_machine_b
336
+ @state_machine_b ||= MyStateMachine.new(
337
+ self, transition_class: StiBActiveRecordModelTransition
338
+ )
339
+ end
340
+
341
+ def metadata
342
+ super || {}
343
+ end
344
+
345
+ def reload(*)
346
+ state_machine_a.reset
347
+ state_machine_b.reset
348
+ super
349
+ end
350
+ end
351
+
352
+ class StiActiveRecordModelTransition < ActiveRecord::Base
353
+ include Statesman::Adapters::ActiveRecordTransition
354
+
355
+ belongs_to :sti_active_record_model
356
+ end
357
+
358
+ class StiAActiveRecordModelTransition < StiActiveRecordModelTransition
359
+ end
360
+
361
+ class StiBActiveRecordModelTransition < StiActiveRecordModelTransition
362
+ end
363
+
364
+ class CreateStiActiveRecordModelMigration < MIGRATION_CLASS
365
+ def change
366
+ create_table :sti_active_record_models do |t|
367
+ t.timestamps null: false
368
+ end
369
+ end
370
+ end
371
+
372
+ class CreateStiActiveRecordModelTransitionMigration < MIGRATION_CLASS
373
+ def change
374
+ create_table :sti_active_record_model_transitions do |t|
375
+ t.string :to_state
376
+ t.integer :sti_active_record_model_id
377
+ t.integer :sort_key
378
+ t.string :type
379
+
380
+ # MySQL doesn't allow default values on text fields
381
+ if ActiveRecord::Base.connection.adapter_name == "Mysql2"
382
+ t.text :metadata
383
+ else
384
+ t.text :metadata, default: "{}"
385
+ end
386
+
387
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
388
+ t.boolean :most_recent, default: true, null: false
389
+ else
390
+ t.boolean :most_recent, default: true
391
+ end
392
+
393
+ t.timestamps null: false
394
+ end
395
+
396
+ add_index :sti_active_record_model_transitions,
397
+ %i[type sti_active_record_model_id sort_key],
398
+ unique: true, name: "sti_sort_key_index"
399
+
400
+ if Statesman::Adapters::ActiveRecord.database_supports_partial_indexes?(ActiveRecord::Base)
401
+ add_index :sti_active_record_model_transitions,
402
+ %i[type sti_active_record_model_id most_recent],
403
+ unique: true,
404
+ where: "most_recent",
405
+ name: "index_sti_active_record_model_transitions_parent_latest"
406
+ else
407
+ add_index :sti_active_record_model_transitions,
408
+ %i[type sti_active_record_model_id most_recent],
409
+ unique: true,
410
+ name: "index_sti_active_record_model_transitions_parent_latest"
411
+ end
412
+ end
281
413
  end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ # `expected_dbs` should be a Hash of the form:
4
+ # {
5
+ # primary: [:writing, :reading],
6
+ # replica: [:reading],
7
+ # }
8
+ RSpec::Matchers.define :exactly_query_databases do |expected_dbs|
9
+ match do |block|
10
+ @expected_dbs = expected_dbs.transform_values(&:to_set).with_indifferent_access
11
+ @actual_dbs = Hash.new { |h, k| h[k] = Set.new }.with_indifferent_access
12
+
13
+ ActiveSupport::Notifications.
14
+ subscribe("sql.active_record") do |_name, _start, _finish, _id, payload|
15
+ pool = payload.fetch(:connection).pool
16
+
17
+ next if pool.is_a?(ActiveRecord::ConnectionAdapters::NullPool)
18
+
19
+ name = pool.db_config.name
20
+ role = pool.role
21
+
22
+ @actual_dbs[name] << role
23
+ end
24
+
25
+ block.call
26
+
27
+ @actual_dbs == @expected_dbs
28
+ end
29
+
30
+ failure_message do |_block|
31
+ "expected to query exactly #{@expected_dbs}, but queried #{@actual_dbs}"
32
+ end
33
+
34
+ supports_block_expectations
35
+ end
data/statesman.gemspec CHANGED
@@ -18,24 +18,22 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
20
20
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
21
  spec.require_paths = ["lib"]
23
22
 
24
- spec.required_ruby_version = ">= 2.2"
23
+ spec.required_ruby_version = ">= 3.0"
25
24
 
26
25
  spec.add_development_dependency "ammeter", "~> 1.1"
27
- spec.add_development_dependency "bundler", "~> 2.1.4"
28
- spec.add_development_dependency "gc_ruboconfig", "~> 2.3.9"
26
+ spec.add_development_dependency "bundler", "~> 2"
27
+ spec.add_development_dependency "gc_ruboconfig", "~> 4.4.1"
29
28
  spec.add_development_dependency "mysql2", ">= 0.4", "< 0.6"
30
- spec.add_development_dependency "pg", ">= 0.18", "<= 1.3"
31
- spec.add_development_dependency "pry"
29
+ spec.add_development_dependency "pg", ">= 0.18", "<= 1.6"
32
30
  spec.add_development_dependency "rails", ">= 5.2"
33
- spec.add_development_dependency "rake", "~> 13.0.0"
31
+ spec.add_development_dependency "rake", "~> 13.1.0"
34
32
  spec.add_development_dependency "rspec", "~> 3.1"
33
+ spec.add_development_dependency "rspec-github", "~> 2.4.0"
35
34
  spec.add_development_dependency "rspec-its", "~> 1.1"
36
- spec.add_development_dependency "rspec-rails", "~> 3.1"
37
- spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.0"
38
- spec.add_development_dependency "sqlite3", "~> 1.4.2"
35
+ spec.add_development_dependency "rspec-rails", "~> 6.0"
36
+ spec.add_development_dependency "sqlite3", "~> 1.7.0"
39
37
  spec.add_development_dependency "timecop", "~> 0.9.1"
40
38
 
41
39
  spec.metadata = {
@@ -44,5 +42,6 @@ Gem::Specification.new do |spec|
44
42
  "documentation_uri" => "#{GITHUB_URL}/blob/master/README.md",
45
43
  "homepage_uri" => GITHUB_URL,
46
44
  "source_code_uri" => GITHUB_URL,
45
+ "rubygems_mfa_required" => "true",
47
46
  }
48
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statesman
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.4.0
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ammeter
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.4
33
+ version: '2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.1.4
40
+ version: '2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gc_ruboconfig
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.9
47
+ version: 4.4.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 2.3.9
54
+ version: 4.4.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mysql2
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  version: '0.18'
82
82
  - - "<="
83
83
  - !ruby/object:Gem::Version
84
- version: '1.3'
84
+ version: '1.6'
85
85
  type: :development
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,21 +91,7 @@ dependencies:
91
91
  version: '0.18'
92
92
  - - "<="
93
93
  - !ruby/object:Gem::Version
94
- version: '1.3'
95
- - !ruby/object:Gem::Dependency
96
- name: pry
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '0'
94
+ version: '1.6'
109
95
  - !ruby/object:Gem::Dependency
110
96
  name: rails
111
97
  requirement: !ruby/object:Gem::Requirement
@@ -126,14 +112,14 @@ dependencies:
126
112
  requirements:
127
113
  - - "~>"
128
114
  - !ruby/object:Gem::Version
129
- version: 13.0.0
115
+ version: 13.1.0
130
116
  type: :development
131
117
  prerelease: false
132
118
  version_requirements: !ruby/object:Gem::Requirement
133
119
  requirements:
134
120
  - - "~>"
135
121
  - !ruby/object:Gem::Version
136
- version: 13.0.0
122
+ version: 13.1.0
137
123
  - !ruby/object:Gem::Dependency
138
124
  name: rspec
139
125
  requirement: !ruby/object:Gem::Requirement
@@ -149,61 +135,61 @@ dependencies:
149
135
  - !ruby/object:Gem::Version
150
136
  version: '3.1'
151
137
  - !ruby/object:Gem::Dependency
152
- name: rspec-its
138
+ name: rspec-github
153
139
  requirement: !ruby/object:Gem::Requirement
154
140
  requirements:
155
141
  - - "~>"
156
142
  - !ruby/object:Gem::Version
157
- version: '1.1'
143
+ version: 2.4.0
158
144
  type: :development
159
145
  prerelease: false
160
146
  version_requirements: !ruby/object:Gem::Requirement
161
147
  requirements:
162
148
  - - "~>"
163
149
  - !ruby/object:Gem::Version
164
- version: '1.1'
150
+ version: 2.4.0
165
151
  - !ruby/object:Gem::Dependency
166
- name: rspec-rails
152
+ name: rspec-its
167
153
  requirement: !ruby/object:Gem::Requirement
168
154
  requirements:
169
155
  - - "~>"
170
156
  - !ruby/object:Gem::Version
171
- version: '3.1'
157
+ version: '1.1'
172
158
  type: :development
173
159
  prerelease: false
174
160
  version_requirements: !ruby/object:Gem::Requirement
175
161
  requirements:
176
162
  - - "~>"
177
163
  - !ruby/object:Gem::Version
178
- version: '3.1'
164
+ version: '1.1'
179
165
  - !ruby/object:Gem::Dependency
180
- name: rspec_junit_formatter
166
+ name: rspec-rails
181
167
  requirement: !ruby/object:Gem::Requirement
182
168
  requirements:
183
169
  - - "~>"
184
170
  - !ruby/object:Gem::Version
185
- version: 0.4.0
171
+ version: '6.0'
186
172
  type: :development
187
173
  prerelease: false
188
174
  version_requirements: !ruby/object:Gem::Requirement
189
175
  requirements:
190
176
  - - "~>"
191
177
  - !ruby/object:Gem::Version
192
- version: 0.4.0
178
+ version: '6.0'
193
179
  - !ruby/object:Gem::Dependency
194
180
  name: sqlite3
195
181
  requirement: !ruby/object:Gem::Requirement
196
182
  requirements:
197
183
  - - "~>"
198
184
  - !ruby/object:Gem::Version
199
- version: 1.4.2
185
+ version: 1.7.0
200
186
  type: :development
201
187
  prerelease: false
202
188
  version_requirements: !ruby/object:Gem::Requirement
203
189
  requirements:
204
190
  - - "~>"
205
191
  - !ruby/object:Gem::Version
206
- version: 1.4.2
192
+ version: 1.7.0
207
193
  - !ruby/object:Gem::Dependency
208
194
  name: timecop
209
195
  requirement: !ruby/object:Gem::Requirement
@@ -225,10 +211,13 @@ executables: []
225
211
  extensions: []
226
212
  extra_rdoc_files: []
227
213
  files:
228
- - ".circleci/config.yml"
214
+ - ".github/dependabot.yml"
215
+ - ".github/workflows/tests.yml"
229
216
  - ".gitignore"
217
+ - ".rspec"
230
218
  - ".rubocop.yml"
231
219
  - ".rubocop_todo.yml"
220
+ - ".ruby-version"
232
221
  - CHANGELOG.md
233
222
  - CONTRIBUTING.md
234
223
  - Gemfile
@@ -249,6 +238,7 @@ files:
249
238
  - lib/statesman/adapters/active_record_transition.rb
250
239
  - lib/statesman/adapters/memory.rb
251
240
  - lib/statesman/adapters/memory_transition.rb
241
+ - lib/statesman/adapters/type_safe_active_record_queries.rb
252
242
  - lib/statesman/callback.rb
253
243
  - lib/statesman/config.rb
254
244
  - lib/statesman/exceptions.rb
@@ -270,6 +260,7 @@ files:
270
260
  - spec/statesman/adapters/memory_spec.rb
271
261
  - spec/statesman/adapters/memory_transition_spec.rb
272
262
  - spec/statesman/adapters/shared_examples.rb
263
+ - spec/statesman/adapters/type_safe_active_record_queries_spec.rb
273
264
  - spec/statesman/callback_spec.rb
274
265
  - spec/statesman/config_spec.rb
275
266
  - spec/statesman/exceptions_spec.rb
@@ -277,6 +268,7 @@ files:
277
268
  - spec/statesman/machine_spec.rb
278
269
  - spec/statesman/utils_spec.rb
279
270
  - spec/support/active_record.rb
271
+ - spec/support/exactly_query_databases.rb
280
272
  - spec/support/generators_shared_examples.rb
281
273
  - statesman.gemspec
282
274
  homepage: https://github.com/gocardless/statesman
@@ -288,6 +280,7 @@ metadata:
288
280
  documentation_uri: https://github.com/gocardless/statesman/blob/master/README.md
289
281
  homepage_uri: https://github.com/gocardless/statesman
290
282
  source_code_uri: https://github.com/gocardless/statesman
283
+ rubygems_mfa_required: 'true'
291
284
  post_install_message:
292
285
  rdoc_options: []
293
286
  require_paths:
@@ -296,35 +289,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
296
289
  requirements:
297
290
  - - ">="
298
291
  - !ruby/object:Gem::Version
299
- version: '2.2'
292
+ version: '3.0'
300
293
  required_rubygems_version: !ruby/object:Gem::Requirement
301
294
  requirements:
302
295
  - - ">="
303
296
  - !ruby/object:Gem::Version
304
297
  version: '0'
305
298
  requirements: []
306
- rubygems_version: 3.1.1
299
+ rubygems_version: 3.4.10
307
300
  signing_key:
308
301
  specification_version: 4
309
302
  summary: A statesman-like state machine library
310
- test_files:
311
- - spec/fixtures/add_constraints_to_most_recent_for_bacon_transitions_with_partial_index.rb
312
- - spec/fixtures/add_constraints_to_most_recent_for_bacon_transitions_without_partial_index.rb
313
- - spec/fixtures/add_most_recent_to_bacon_transitions.rb
314
- - spec/generators/statesman/active_record_transition_generator_spec.rb
315
- - spec/generators/statesman/migration_generator_spec.rb
316
- - spec/spec_helper.rb
317
- - spec/statesman/adapters/active_record_queries_spec.rb
318
- - spec/statesman/adapters/active_record_spec.rb
319
- - spec/statesman/adapters/active_record_transition_spec.rb
320
- - spec/statesman/adapters/memory_spec.rb
321
- - spec/statesman/adapters/memory_transition_spec.rb
322
- - spec/statesman/adapters/shared_examples.rb
323
- - spec/statesman/callback_spec.rb
324
- - spec/statesman/config_spec.rb
325
- - spec/statesman/exceptions_spec.rb
326
- - spec/statesman/guard_spec.rb
327
- - spec/statesman/machine_spec.rb
328
- - spec/statesman/utils_spec.rb
329
- - spec/support/active_record.rb
330
- - spec/support/generators_shared_examples.rb
303
+ test_files: []