default_value_for 4.0.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -0
- data/default_value_for.gemspec +4 -4
- data/lib/default_value_for.rb +3 -8
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c80aedef2e43b52fc2a1b30f73d1a3dc67ed4681593e22791850451f923670fa
|
4
|
+
data.tar.gz: ca8f91561bd47228f36f6ebd4cfaa399513e1a28bf5cdc580a533a463529c4e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3844921bb7754bf60e50ea6e31138ce2da56d59a46e858234d53359889e9f8bf36b8746c388fcc35bec245544a5a0cdc616ce49b29fb2923789233bc8cb274c3
|
7
|
+
data.tar.gz: 172aef2c3dfe0d0f69647cc54547284afa27a557c6625d648492d19b61fe62efcfe7f884b208e42c81d7b141bff8eb165d38e3b678c18c95159be6faa8753e0f
|
data/Rakefile
CHANGED
@@ -11,6 +11,8 @@ rails_versions = %w(
|
|
11
11
|
6.1
|
12
12
|
7.0
|
13
13
|
7.1
|
14
|
+
7.2
|
15
|
+
8.0
|
14
16
|
)
|
15
17
|
|
16
18
|
rails_versions.each do |version|
|
@@ -27,6 +29,7 @@ rails_versions.each do |version|
|
|
27
29
|
namespace :test do
|
28
30
|
desc "Test with Rails #{version}.x"
|
29
31
|
task :"rails#{dotless}" do
|
32
|
+
sh 'appraisal install'
|
30
33
|
ENV['BUNDLE_GEMFILE'] = "gemfiles/rails_#{dotless}.gemfile"
|
31
34
|
ruby "test.rb"
|
32
35
|
end
|
@@ -36,6 +39,7 @@ end
|
|
36
39
|
namespace :test do
|
37
40
|
desc "Test with all supported Rails versions"
|
38
41
|
task :railsall do
|
42
|
+
sh 'appraisal install'
|
39
43
|
rails_versions.each do |version|
|
40
44
|
dotless = version.delete('.')
|
41
45
|
ENV['BUNDLE_GEMFILE'] = "gemfiles/rails_#{dotless}.gemfile"
|
data/default_value_for.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{default_value_for}
|
3
|
-
s.version = "4.
|
3
|
+
s.version = "4.1.1"
|
4
4
|
s.summary = %q{Provides a way to specify default values for ActiveRecord models}
|
5
5
|
s.description = %q{The default_value_for plugin allows one to define default values for ActiveRecord models in a declarative manner}
|
6
6
|
s.email = %q{software-signing@phusion.nl}
|
@@ -14,9 +14,9 @@ Gem::Specification.new do |s|
|
|
14
14
|
'lib/default_value_for.rb',
|
15
15
|
'lib/default_value_for/railtie.rb'
|
16
16
|
]
|
17
|
-
s.add_dependency 'activerecord', '>= 6.1', '<
|
18
|
-
s.add_development_dependency 'actionpack', '>= 6.1', '<
|
19
|
-
s.add_development_dependency 'railties', '>= 6.1', '<
|
17
|
+
s.add_dependency 'activerecord', '>= 6.1', '< 8.1'
|
18
|
+
s.add_development_dependency 'actionpack', '>= 6.1', '< 8.1'
|
19
|
+
s.add_development_dependency 'railties', '>= 6.1', '< 8.1'
|
20
20
|
s.add_development_dependency 'minitest', '>= 5.0'
|
21
21
|
s.add_development_dependency 'minitest-around'
|
22
22
|
s.add_development_dependency 'appraisal'
|
data/lib/default_value_for.rb
CHANGED
@@ -65,7 +65,7 @@ module DefaultValueFor
|
|
65
65
|
allows_nil = opts.fetch('allows_nil', true)
|
66
66
|
end
|
67
67
|
|
68
|
-
if !
|
68
|
+
if !singleton_methods(false).include?(:_default_attribute_values)
|
69
69
|
include(InstanceMethods)
|
70
70
|
|
71
71
|
after_initialize :set_default_values
|
@@ -73,15 +73,10 @@ module DefaultValueFor
|
|
73
73
|
class_attribute :_default_attribute_values
|
74
74
|
class_attribute :_default_attribute_values_not_allowing_nil
|
75
75
|
|
76
|
-
extend(DelayedClassMethods)
|
77
|
-
init_hash = true
|
78
|
-
else
|
79
|
-
init_hash = !singleton_methods(false).include?(:_default_attribute_values)
|
80
|
-
end
|
81
|
-
|
82
|
-
if init_hash
|
83
76
|
self._default_attribute_values = {}
|
84
77
|
self._default_attribute_values_not_allowing_nil = []
|
78
|
+
|
79
|
+
extend(DelayedClassMethods)
|
85
80
|
end
|
86
81
|
|
87
82
|
if block_given?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: default_value_for
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hongli Lai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '6.1'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '8.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '6.1'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '8.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: actionpack
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '6.1'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '8.1'
|
43
43
|
type: :development
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '6.1'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '8.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: railties
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
version: '6.1'
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '8.1'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,7 +69,7 @@ dependencies:
|
|
69
69
|
version: '6.1'
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
72
|
+
version: '8.1'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: minitest
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.5.
|
163
|
+
rubygems_version: 3.5.22
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Provides a way to specify default values for ActiveRecord models
|