state_machines-activerecord 0.9.0 → 0.10.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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/README.md +1 -2
  4. data/lib/state_machines/integrations/active_record/locale.rb +2 -0
  5. data/lib/state_machines/integrations/active_record/version.rb +3 -1
  6. data/lib/state_machines/integrations/active_record.rb +22 -81
  7. data/lib/state_machines-activerecord.rb +2 -0
  8. data/test/files/models/post.rb +2 -0
  9. data/test/integration_test.rb +2 -0
  10. data/test/machine_by_default_test.rb +2 -0
  11. data/test/machine_errors_test.rb +2 -0
  12. data/test/machine_multiple_test.rb +2 -0
  13. data/test/machine_nested_action_test.rb +2 -0
  14. data/test/machine_unmigrated_test.rb +2 -0
  15. data/test/machine_with_aliased_attribute_test.rb +2 -0
  16. data/test/machine_with_callbacks_test.rb +2 -0
  17. data/test/machine_with_column_state_attribute_test.rb +2 -0
  18. data/test/machine_with_complex_pluralization_scopes_test.rb +2 -0
  19. data/test/machine_with_conflicting_predicate_test.rb +2 -0
  20. data/test/machine_with_conflicting_state_name_test.rb +4 -2
  21. data/test/machine_with_custom_attribute_test.rb +2 -0
  22. data/test/machine_with_default_scope_test.rb +2 -0
  23. data/test/machine_with_different_column_default_test.rb +2 -0
  24. data/test/machine_with_different_integer_column_default_test.rb +2 -0
  25. data/test/machine_with_dirty_attribute_and_custom_attributes_during_loopback_test.rb +2 -0
  26. data/test/machine_with_dirty_attribute_and_state_events_test.rb +2 -0
  27. data/test/machine_with_dirty_attributes_and_custom_attribute_test.rb +2 -0
  28. data/test/machine_with_dirty_attributes_during_loopback_test.rb +2 -0
  29. data/test/machine_with_dirty_attributes_test.rb +2 -0
  30. data/test/machine_with_dynamic_initial_state_test.rb +2 -0
  31. data/test/machine_with_event_attributes_on_autosave_test.rb +2 -0
  32. data/test/machine_with_event_attributes_on_custom_action_test.rb +2 -0
  33. data/test/machine_with_event_attributes_on_save_bang_test.rb +2 -0
  34. data/test/machine_with_event_attributes_on_save_test.rb +2 -0
  35. data/test/machine_with_event_attributes_on_validation_test.rb +2 -0
  36. data/test/machine_with_events_test.rb +2 -0
  37. data/test/machine_with_failed_action_test.rb +2 -0
  38. data/test/machine_with_failed_after_callbacks_test.rb +2 -0
  39. data/test/machine_with_failed_before_callbacks_test.rb +2 -0
  40. data/test/machine_with_initialized_state_test.rb +2 -0
  41. data/test/machine_with_internationalization_test.rb +2 -0
  42. data/test/machine_with_loopback_test.rb +2 -0
  43. data/test/machine_with_non_column_state_attribute_defined_test.rb +2 -0
  44. data/test/machine_with_same_column_default_test.rb +2 -0
  45. data/test/machine_with_same_integer_column_default_test.rb +2 -0
  46. data/test/machine_with_scopes_and_joins_test.rb +2 -0
  47. data/test/machine_with_scopes_and_owner_subclass_test.rb +2 -0
  48. data/test/machine_with_scopes_test.rb +2 -0
  49. data/test/machine_with_state_driven_validations_test.rb +2 -0
  50. data/test/machine_with_states_test.rb +2 -0
  51. data/test/machine_with_static_initial_state_test.rb +2 -0
  52. data/test/machine_with_transactions_test.rb +2 -0
  53. data/test/machine_with_validations_and_custom_attribute_test.rb +2 -0
  54. data/test/machine_with_validations_test.rb +2 -0
  55. data/test/machine_without_database_test.rb +2 -0
  56. data/test/machine_without_transactions_test.rb +2 -0
  57. data/test/model_test.rb +2 -0
  58. data/test/test_helper.rb +3 -4
  59. metadata +8 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 570d0e44cce8dade9ceb135c6e24cfcafb7dc0325ee8f40d99658d663072e234
4
- data.tar.gz: 2195bc14693c748c3248c3ddd42bc0a26faccbdf78285c6d24f17e54bd3ec0fd
3
+ metadata.gz: a5e8b447b65a1f99ad367425556a3e726b3f42be5056af03a2a48e741851ff72
4
+ data.tar.gz: 801a7943d18a71f506acefedb764cb8ed0a9caa1c459893df99f3b21419c78f7
5
5
  SHA512:
6
- metadata.gz: dde59866fccfe87fbd05658fd0f0b5d92c2129ff3e448c75983722e7a5468cc3201f63dfb319442a60e536e4774ecfd61429d0e979e454abba568e10a1b7cc15
7
- data.tar.gz: f78734f5c798ae8f468d69d22e1983b95839dcf724e6b7c1e6563f81a3f1976930b6ff52d275163feaccd0419888a9d754f47d587a112df019a9c9804f21bd31
6
+ metadata.gz: c6794e0f3d9e6835682f4a541bb8bde8210599749621c262ed164bae482c78f3ec40aa6cc4279db5ed62583bd5d2f30476f43f49f5adc149ac80eb9df20ee487
7
+ data.tar.gz: 0fc0b42cc6de4c17f4a844634647dd0e0245933c6a713cf51e68655b4354e03801b0a6b63e61c1e27298a1db56ae8559a605972e2a6ef3cc879f32f75691c3b6
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Copyright (c) 2006-2012 Aaron Pfeifer
2
- Copyright (c) 2014-2023 Abdelkader Boudih
2
+ Copyright (c) 2014-2025 Abdelkader Boudih
3
3
 
4
4
  MIT License
5
5
 
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- [![Build Status](https://travis-ci.com/state-machines/state_machines-activerecord.svg?branch=master)](https://travis-ci.com/state-machines/state_machines-activerecord)
2
- [![Code Climate](https://codeclimate.com/github/state-machines/state_machines-activerecord.svg)](https://codeclimate.com/github/state-machines/state_machines-activerecord)
1
+ [![Build Status](https://github.com/state-machines/state_machines-activerecord/actions/workflows/ruby.yml/badge.svg)](https://github.com/state-machines/state_machines-activerecord/actions/workflows/ruby.yml)
3
2
 
4
3
  # StateMachines Active Record Integration
5
4
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  { en: {
2
4
  activerecord: {
3
5
  errors: {
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module StateMachines
2
4
  module Integrations
3
5
  module ActiveRecord
4
- VERSION = '0.9.0'
6
+ VERSION = '0.10.0'
5
7
  end
6
8
  end
7
9
  end
@@ -78,16 +78,14 @@ module StateMachines
78
78
  # === Security implications
79
79
  #
80
80
  # Beware that public event attributes mean that events can be fired
81
- # whenever mass-assignment is being used. If you want to prevent malicious
82
- # users from tampering with events through URLs / forms, the attribute
83
- # should be protected like so:
84
- #
85
- # class Vehicle < ApplicationRecord
86
- # attr_protected :state_event
87
- # # attr_accessible ... # Alternative technique
88
- #
89
- # state_machine do
90
- # ...
81
+ # whenever mass-assignment is being used. If you want to prevent malicious
82
+ # users from tampering with events through URLs / forms, you should use
83
+ # Rails' strong parameters to control which attributes are permitted:
84
+ #
85
+ # class VehiclesController < ApplicationController
86
+ # def vehicle_params
87
+ # params.require(:vehicle).permit(:color, :make, :model)
88
+ # # Exclude state_event to prevent tampering
91
89
  # end
92
90
  # end
93
91
  #
@@ -95,8 +93,7 @@ module StateMachines
95
93
  # you can build two state machines (one public and one protected) like so:
96
94
  #
97
95
  # class Vehicle < ApplicationRecord
98
- # attr_protected :state_event # Prevent access to events in the first machine
99
- #
96
+ # # Define private machine
100
97
  # state_machine do
101
98
  # # Define private events here
102
99
  # end
@@ -105,6 +102,8 @@ module StateMachines
105
102
  # state_machine :public_state, :attribute => :state do
106
103
  # # Define public events here
107
104
  # end
105
+ #
106
+ # # Control access via strong parameters in your controller
108
107
  # end
109
108
  #
110
109
  # == Transactions
@@ -199,27 +198,28 @@ module StateMachines
199
198
  #
200
199
  # == Scopes
201
200
  #
202
- # To assist in filtering models with specific states, a series of named
203
- # scopes are defined on the model for finding records with or without a
201
+ # To assist in filtering models with specific states, a series of scopes
202
+ # are defined on the model for finding records with or without a
204
203
  # particular set of states.
205
204
  #
206
- # These named scopes are essentially the functional equivalent of the
205
+ # These scopes are essentially the functional equivalent of the
207
206
  # following definitions:
208
207
  #
209
208
  # class Vehicle < ApplicationRecord
210
209
  # # with_states also aliased to with_state
210
+ # scope :with_states, ->(states) { where(state: states) }
211
211
  #
212
- # named_scope :without_states, lambda {|*states| {:conditions => ['state NOT IN (?)', states]}}
213
212
  # # without_states also aliased to without_state
213
+ # scope :without_states, ->(states) { where.not(state: states) }
214
214
  # end
215
215
  #
216
216
  # *Note*, however, that the states are converted to their stored values
217
217
  # before being passed into the query.
218
218
  #
219
- # Because of the way named scopes work in ActiveRecord, they can be
219
+ # Because of the way scopes work in ActiveRecord, they can be
220
220
  # chained like so:
221
221
  #
222
- # Vehicle.with_state(:parked).all(:order => 'id DESC')
222
+ # Vehicle.with_state(:parked).order(id: :desc)
223
223
  #
224
224
  # Note that states can also be referenced by the string version of their
225
225
  # name:
@@ -266,7 +266,7 @@ module StateMachines
266
266
  # your callback to roll back. You can work around this issue like so:
267
267
  #
268
268
  # class TransitionLog < ApplicationRecord
269
- # establish_connection Rails.env.to_sym
269
+ # connects_to database: { writing: :primary, reading: :primary }
270
270
  # end
271
271
  #
272
272
  # class Vehicle < ApplicationRecord
@@ -279,7 +279,7 @@ module StateMachines
279
279
  # end
280
280
  # end
281
281
  #
282
- # The +TransitionLog+ model establishes a second connection to the database
282
+ # The +TransitionLog+ model establishes a separate connection to the database
283
283
  # that allows new records to be saved without being affected by rollbacks
284
284
  # in the +Vehicle+ model's transaction.
285
285
  #
@@ -304,65 +304,9 @@ module StateMachines
304
304
  # * (-) end transaction (if enabled)
305
305
  # * (9) after_commit
306
306
  #
307
- # == Observers
308
- #
309
- # In addition to support for ActiveRecord-like hooks, there is additional
310
- # support for ActiveRecord observers. Because of the way ActiveRecord
311
- # observers are designed, there is less flexibility around the specific
312
- # transitions that can be hooked in. However, a large number of hooks
313
- # *are* supported. For example, if a transition for a record's +state+
314
- # attribute changes the state from +parked+ to +idling+ via the +ignite+
315
- # event, the following observer methods are supported:
316
- # * before/after/after_failure_to-_ignite_from_parked_to_idling
317
- # * before/after/after_failure_to-_ignite_from_parked
318
- # * before/after/after_failure_to-_ignite_to_idling
319
- # * before/after/after_failure_to-_ignite
320
- # * before/after/after_failure_to-_transition_state_from_parked_to_idling
321
- # * before/after/after_failure_to-_transition_state_from_parked
322
- # * before/after/after_failure_to-_transition_state_to_idling
323
- # * before/after/after_failure_to-_transition_state
324
- # * before/after/after_failure_to-_transition
325
- #
326
- # The following class shows an example of some of these hooks:
327
- #
328
- # class VehicleObserver < ActiveRecord::Observer
329
- # def before_save(vehicle)
330
- # # log message
331
- # end
332
- #
333
- # # Callback for :ignite event *before* the transition is performed
334
- # def before_ignite(vehicle, transition)
335
- # # log message
336
- # end
337
- #
338
- # # Callback for :ignite event *after* the transition has been performed
339
- # def after_ignite(vehicle, transition)
340
- # # put on seatbelt
341
- # end
342
- #
343
- # # Generic transition callback *before* the transition is performed
344
- # def after_transition(vehicle, transition)
345
- # Audit.log(vehicle, transition)
346
- # end
347
- # end
348
- #
349
- # More flexible transition callbacks can be defined directly within the
350
- # model as described in StateMachines::Machine#before_transition
351
- # and StateMachines::Machine#after_transition.
352
- #
353
- # To define a single observer for multiple state machines:
354
- #
355
- # class StateMachineObserver < ActiveRecord::Observer
356
- # observe Vehicle, Switch, Project
357
- #
358
- # def after_transition(record, transition)
359
- # Audit.log(record, transition)
360
- # end
361
- # end
362
- #
363
307
  # == Internationalization
364
308
  #
365
- # In Rails 2.2+, any error message that is generated from performing invalid
309
+ # Any error message that is generated from performing invalid
366
310
  # transitions can be localized. The following default translations are used:
367
311
  #
368
312
  # en:
@@ -375,9 +319,6 @@ module StateMachines
375
319
  # # %{value} = attribute value, %{event} = Human event name, %{state} = Human current state name
376
320
  # invalid_transition: "cannot transition via %{event}"
377
321
  #
378
- # Notice that the interpolation syntax is %{key} in Rails 3+. In Rails 2.x,
379
- # the appropriate syntax is {{key}}.
380
- #
381
322
  # You can override these for a specific model like so:
382
323
  #
383
324
  # en:
@@ -515,7 +456,7 @@ module StateMachines
515
456
 
516
457
  private
517
458
 
518
- # Defines a new named scope with the given name
459
+ # Defines a new scope with the given name
519
460
  def create_scope(name, scope)
520
461
  lambda { |model, values| model.where(scope.call(values)) }
521
462
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support'
2
4
  require 'state_machines/integrations/active_record'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ActiveRecord::Base.connection.create_table(:posts, :force => true) do |t|
2
4
  t.string :title
3
5
  t.string :content
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class IntegrationTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineByDefaultTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineErrorsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineMultipleTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineNestedActionTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineUnmigratedTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithAliasedAttributeTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithCallbacksTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithColumnStateAttributeTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithComplexPluralizationScopesTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithConflictingPredicateTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require 'stringio'
3
5
 
@@ -12,14 +14,14 @@ class MachineWithConflictingStateNameTest < BaseTestCase
12
14
  @machine = StateMachines::Machine.new(@model)
13
15
  @machine.state :state
14
16
 
15
- assert_match(/^Instance method "state\?" is already defined in Foo, use generic helper instead.*\n$/, $stderr.string)
17
+ assert_match(/^Instance method "state\?" is already defined in .+, use generic helper instead.*\n$/, $stderr.string)
16
18
  end
17
19
 
18
20
  def test_should_output_warning_with_same_machine_attribute
19
21
  @machine = StateMachines::Machine.new(@model, :public_state, :attribute => :state)
20
22
  @machine.state :state
21
23
 
22
- assert_match(/^Instance method "state\?" is already defined in Foo, use generic helper instead.*\n$/, $stderr.string)
24
+ assert_match(/^Instance method "state\?" is already defined in .+, use generic helper instead.*\n$/, $stderr.string)
23
25
  end
24
26
 
25
27
  def teardown
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require 'stringio'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDefaultScopeTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require 'stringio'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require 'stringio'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDirtyAttributeAndCustomAttributesDuringLoopbackTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDirtyAttributeAndStateEventsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDirtyAttributesAndCustomAttributeTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDirtyAttributesDuringLoopbackTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDirtyAttributesTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithDynamicInitialStateTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventAttributesOnAutosaveTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventAttributesOnCustomActionTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventAttributesOnSaveBangTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventAttributesOnSaveTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventAttributesOnValidationTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithEventsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithFailedActionTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithFailedAfterCallbacksTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithFailedBeforeCallbacksTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithInitializedStateTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithInternationalizationTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithLoopbackTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithNonColumnStateAttributeDefinedTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithSameColumnDefaultTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require 'stringio'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithScopesAndJoinsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithScopesAndOwnerSubclassTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithScopesTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithStateDrivenValidationsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithStatesTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithStaticInitialStateTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithTransactionsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithValidationsAndCustomAttributeTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithValidationsTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithoutDatabaseTest < BaseTestCase
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  class MachineWithoutTransactionsTest < BaseTestCase
data/test/model_test.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
  require_relative 'files/models/post'
3
5
 
data/test/test_helper.rb CHANGED
@@ -1,7 +1,6 @@
1
- begin
2
- require 'pry-byebug'
3
- rescue LoadError
4
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'debug' if RUBY_ENGINE == 'ruby'
5
4
  require 'minitest/reporters'
6
5
  Minitest::Reporters.use!(Minitest::Reporters::SpecReporter.new)
7
6
  require 'state_machines-activerecord'
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
8
8
  - Aaron Pfeifer
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2023-06-30 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: state_machines-activemodel
@@ -17,28 +16,28 @@ dependencies:
17
16
  requirements:
18
17
  - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: 0.9.0
19
+ version: 0.10.0
21
20
  type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - ">="
26
25
  - !ruby/object:Gem::Version
27
- version: 0.9.0
26
+ version: 0.10.0
28
27
  - !ruby/object:Gem::Dependency
29
28
  name: activerecord
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
31
  - - ">="
33
32
  - !ruby/object:Gem::Version
34
- version: '6.0'
33
+ version: '7.1'
35
34
  type: :runtime
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
38
  - - ">="
40
39
  - !ruby/object:Gem::Version
41
- version: '6.0'
40
+ version: '7.1'
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rake
44
43
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +178,6 @@ homepage: https://github.com/state-machines/state_machines-activerecord/
179
178
  licenses:
180
179
  - MIT
181
180
  metadata: {}
182
- post_install_message:
183
181
  rdoc_options: []
184
182
  require_paths:
185
183
  - lib
@@ -187,15 +185,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
185
  requirements:
188
186
  - - ">="
189
187
  - !ruby/object:Gem::Version
190
- version: '3.0'
188
+ version: '3.1'
191
189
  required_rubygems_version: !ruby/object:Gem::Requirement
192
190
  requirements:
193
191
  - - ">="
194
192
  - !ruby/object:Gem::Version
195
193
  version: '0'
196
194
  requirements: []
197
- rubygems_version: 3.4.10
198
- signing_key:
195
+ rubygems_version: 3.6.7
199
196
  specification_version: 4
200
197
  summary: State machines Active Record Integration
201
198
  test_files: