enum_state_machine 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/enum_state_machine.gemspec +1 -1
- data/lib/enum_state_machine/integrations/active_model.rb +1 -1
- data/lib/enum_state_machine/integrations/active_record.rb +2 -2
- data/lib/enum_state_machine/integrations/base.rb +1 -1
- data/lib/enum_state_machine/version.rb +1 -1
- data/test/unit/eval_helpers_test.rb +0 -2
- data/test/unit/machine_test.rb +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e22e2e5a8d0d447fb75fe6b2b5474c1d444a4f595b5684fcee5ff35e0ed5e5
|
4
|
+
data.tar.gz: 0bd801c9aec9124f4710101bf7d61b6e854552c7b23af65755b1acd22963d38d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e91f1e027f08509cc346882786d7f70d48bc552834954f7775d1252ee280a18b72d7f44d3c4167ed90816b33688c2fb51831dd4b59ad131ebd786a9103dffd
|
7
|
+
data.tar.gz: c58ef00910ab7f8cff3be1d52ebc77276754d45f1f1c4f79a3ff869894dfe84f3d902afd39c8d8a56632f83a3ebd70ace03ba9377b6ef172b7a2e77cfb90623c
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.6
|
1
|
+
2.7.6
|
data/enum_state_machine.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.extra_rdoc_files = %w(README.md CHANGELOG.md LICENSE)
|
18
18
|
s.license = 'MIT'
|
19
19
|
|
20
|
-
s.add_dependency "rails", "
|
20
|
+
s.add_dependency "rails", ">= 6.0", "< 7.0"
|
21
21
|
s.add_dependency "activerecord-deprecated_finders", ">= 1.0.3"
|
22
22
|
#s.add_dependency "rails-observers", ">= 0.1.2"
|
23
23
|
s.add_dependency "power_enum", "> 2.8", "< 4.0"
|
@@ -382,7 +382,7 @@ module EnumStateMachine
|
|
382
382
|
end
|
383
383
|
|
384
384
|
default_options = default_error_message_options(object, attribute, message)
|
385
|
-
object.errors.add(attribute, message, options.merge(default_options))
|
385
|
+
object.errors.add(attribute, message, **options.merge(default_options))
|
386
386
|
end
|
387
387
|
end
|
388
388
|
|
@@ -486,11 +486,11 @@ module EnumStateMachine
|
|
486
486
|
def define_action_hook
|
487
487
|
if action_hook == :save
|
488
488
|
define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
|
489
|
-
def save(
|
489
|
+
def save(**)
|
490
490
|
self.class.state_machine(#{name.inspect}).send(:around_save, self) { super }
|
491
491
|
end
|
492
492
|
|
493
|
-
def save!(
|
493
|
+
def save!(**)
|
494
494
|
self.class.state_machine(#{name.inspect}).send(:around_save, self) { super } || raise(ActiveRecord::RecordInvalid.new(self))
|
495
495
|
end
|
496
496
|
|
@@ -78,7 +78,7 @@ module EnumStateMachine
|
|
78
78
|
# support i18n.
|
79
79
|
def locale_path
|
80
80
|
path = "#{File.dirname(__FILE__)}/#{integration_name}/locale.rb"
|
81
|
-
path if File.
|
81
|
+
path if File.exist?(path)
|
82
82
|
end
|
83
83
|
|
84
84
|
# Extends the given object with any version overrides that are currently
|
data/test/unit/machine_test.rb
CHANGED
@@ -3227,26 +3227,26 @@ begin
|
|
3227
3227
|
|
3228
3228
|
def test_should_save_file_with_class_name_by_default
|
3229
3229
|
@machine.draw
|
3230
|
-
assert File.
|
3230
|
+
assert File.exist?("./#{@klass.name}_state.png")
|
3231
3231
|
end
|
3232
3232
|
|
3233
3233
|
def test_should_allow_base_name_to_be_customized
|
3234
3234
|
name = "machine_#{rand(1000000)}"
|
3235
3235
|
@machine.draw(:name => name)
|
3236
3236
|
@path = "./#{name}.png"
|
3237
|
-
assert File.
|
3237
|
+
assert File.exist?(@path)
|
3238
3238
|
end
|
3239
3239
|
|
3240
3240
|
def test_should_allow_format_to_be_customized
|
3241
3241
|
@machine.draw(:format => 'jpg')
|
3242
3242
|
@path = "./#{@klass.name}_state.jpg"
|
3243
|
-
assert File.
|
3243
|
+
assert File.exist?(@path)
|
3244
3244
|
end
|
3245
3245
|
|
3246
3246
|
def test_should_allow_path_to_be_customized
|
3247
3247
|
@machine.draw(:path => "#{File.dirname(__FILE__)}/")
|
3248
3248
|
@path = "#{File.dirname(__FILE__)}/#{@klass.name}_state.png"
|
3249
|
-
assert File.
|
3249
|
+
assert File.exist?(@path)
|
3250
3250
|
end
|
3251
3251
|
|
3252
3252
|
def test_should_allow_orientation_to_be_landscape
|
metadata
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enum_state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The HornsAndHooves Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '7.0'
|
@@ -24,9 +24,9 @@ dependencies:
|
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '7.0'
|
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: '0'
|
283
283
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
284
|
+
rubygems_version: 3.1.6
|
285
285
|
signing_key:
|
286
286
|
specification_version: 4
|
287
287
|
summary: Enum State machines for attributes
|