assignable_values 1.1.0 → 1.1.1
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/.github/workflows/test.yml +3 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile.5.0.lock +1 -1
- data/Gemfile.5.1.lock +1 -1
- data/Gemfile.5.1.pg.lock +1 -1
- data/Gemfile.6.1.pg.lock +1 -1
- data/Gemfile.7.1.pg.lock +1 -1
- data/Gemfile.8.0.pg +16 -0
- data/Gemfile.8.0.pg.lock +89 -0
- data/lib/assignable_values/active_record/restriction/scalar_attribute.rb +1 -1
- data/lib/assignable_values/humanizable_string.rb +1 -1
- data/lib/assignable_values/version.rb +1 -1
- data/spec/assignable_values/active_record_spec.rb +18 -2
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4d3f5f5330d96f6c1f6c6dbeabc274d8effa885438634b1838464f2699955aac
|
|
4
|
+
data.tar.gz: 7bd4369a6cf54379268c9ea169a2a6c98fe9ab09f424e495016dcbc405f1525a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3dc0f63c34dd4dfddb7f3ebbc10489403c17249e660338cafbb3732ca86019a7e09f7e428f4c1e4c8e25d4cc2375194ad6332d802e3f7d68647f1a2018c59f2
|
|
7
|
+
data.tar.gz: eef181f993e85e42f1fac008b51507cb51c4a00b7297f78651d15654456272dc84427bff79164c1a8e8d917eca35eea7151803ed75e27a299e750f1ec5b70cc5
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.5.0.lock
CHANGED
data/Gemfile.5.1.lock
CHANGED
data/Gemfile.5.1.pg.lock
CHANGED
data/Gemfile.6.1.pg.lock
CHANGED
data/Gemfile.7.1.pg.lock
CHANGED
data/Gemfile.8.0.pg
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# Runtime dependencies
|
|
4
|
+
gem 'activerecord', '~>8.0.0'
|
|
5
|
+
gem 'i18n'
|
|
6
|
+
gem 'pg'
|
|
7
|
+
|
|
8
|
+
# Development dependencies
|
|
9
|
+
gem 'rake'
|
|
10
|
+
gem 'database_cleaner'
|
|
11
|
+
gem 'rspec'
|
|
12
|
+
gem 'rspec_candy'
|
|
13
|
+
gem 'gemika', '~> 0.8.0'
|
|
14
|
+
|
|
15
|
+
# Gem under test
|
|
16
|
+
gem 'assignable_values', :path => '.'
|
data/Gemfile.8.0.pg.lock
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
assignable_values (1.1.1)
|
|
5
|
+
activerecord (>= 2.3)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activemodel (8.0.0.1)
|
|
11
|
+
activesupport (= 8.0.0.1)
|
|
12
|
+
activerecord (8.0.0.1)
|
|
13
|
+
activemodel (= 8.0.0.1)
|
|
14
|
+
activesupport (= 8.0.0.1)
|
|
15
|
+
timeout (>= 0.4.0)
|
|
16
|
+
activesupport (8.0.0.1)
|
|
17
|
+
base64
|
|
18
|
+
benchmark (>= 0.3)
|
|
19
|
+
bigdecimal
|
|
20
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
21
|
+
connection_pool (>= 2.2.5)
|
|
22
|
+
drb
|
|
23
|
+
i18n (>= 1.6, < 2)
|
|
24
|
+
logger (>= 1.4.2)
|
|
25
|
+
minitest (>= 5.1)
|
|
26
|
+
securerandom (>= 0.3)
|
|
27
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
28
|
+
uri (>= 0.13.1)
|
|
29
|
+
base64 (0.2.0)
|
|
30
|
+
benchmark (0.4.0)
|
|
31
|
+
bigdecimal (3.1.8)
|
|
32
|
+
concurrent-ruby (1.3.4)
|
|
33
|
+
connection_pool (2.4.1)
|
|
34
|
+
database_cleaner (2.1.0)
|
|
35
|
+
database_cleaner-active_record (>= 2, < 3)
|
|
36
|
+
database_cleaner-active_record (2.2.0)
|
|
37
|
+
activerecord (>= 5.a)
|
|
38
|
+
database_cleaner-core (~> 2.0.0)
|
|
39
|
+
database_cleaner-core (2.0.1)
|
|
40
|
+
diff-lcs (1.5.1)
|
|
41
|
+
drb (2.2.1)
|
|
42
|
+
gemika (0.8.3)
|
|
43
|
+
i18n (1.14.6)
|
|
44
|
+
concurrent-ruby (~> 1.0)
|
|
45
|
+
logger (1.6.3)
|
|
46
|
+
minitest (5.25.4)
|
|
47
|
+
pg (1.5.9)
|
|
48
|
+
rake (13.2.1)
|
|
49
|
+
rspec (3.13.0)
|
|
50
|
+
rspec-core (~> 3.13.0)
|
|
51
|
+
rspec-expectations (~> 3.13.0)
|
|
52
|
+
rspec-mocks (~> 3.13.0)
|
|
53
|
+
rspec-core (3.13.2)
|
|
54
|
+
rspec-support (~> 3.13.0)
|
|
55
|
+
rspec-expectations (3.13.3)
|
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
57
|
+
rspec-support (~> 3.13.0)
|
|
58
|
+
rspec-mocks (3.13.2)
|
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
60
|
+
rspec-support (~> 3.13.0)
|
|
61
|
+
rspec-support (3.13.2)
|
|
62
|
+
rspec_candy (0.5.1)
|
|
63
|
+
rspec
|
|
64
|
+
sneaky-save
|
|
65
|
+
securerandom (0.4.0)
|
|
66
|
+
sneaky-save (0.1.3)
|
|
67
|
+
activerecord (>= 3.2.0)
|
|
68
|
+
timeout (0.4.2)
|
|
69
|
+
tzinfo (2.0.6)
|
|
70
|
+
concurrent-ruby (~> 1.0)
|
|
71
|
+
uri (1.0.2)
|
|
72
|
+
|
|
73
|
+
PLATFORMS
|
|
74
|
+
ruby
|
|
75
|
+
x86_64-linux
|
|
76
|
+
|
|
77
|
+
DEPENDENCIES
|
|
78
|
+
activerecord (~> 8.0.0)
|
|
79
|
+
assignable_values!
|
|
80
|
+
database_cleaner
|
|
81
|
+
gemika (~> 0.8.0)
|
|
82
|
+
i18n
|
|
83
|
+
pg
|
|
84
|
+
rake
|
|
85
|
+
rspec
|
|
86
|
+
rspec_candy
|
|
87
|
+
|
|
88
|
+
BUNDLED WITH
|
|
89
|
+
2.5.22
|
|
@@ -88,7 +88,7 @@ module AssignableValues
|
|
|
88
88
|
|
|
89
89
|
unless multiple
|
|
90
90
|
define_method :"humanized_#{restriction.property.to_s.pluralize}" do
|
|
91
|
-
ActiveSupport::Deprecation.warn("humanized_<value>s is deprecated, use humanized_assignable_<value>s instead", caller)
|
|
91
|
+
ActiveSupport::Deprecation.new.warn("humanized_<value>s is deprecated, use humanized_assignable_<value>s instead", caller)
|
|
92
92
|
restriction.humanized_assignable_values(self)
|
|
93
93
|
end
|
|
94
94
|
end
|
|
@@ -8,7 +8,7 @@ class HumanizableString < String
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def humanized
|
|
11
|
-
ActiveSupport::Deprecation.warn("assignable_<value>.humanized is deprecated, use humanized_assignable_<value>s.humanized instead", caller)
|
|
11
|
+
ActiveSupport::Deprecation.new.warn("assignable_<value>.humanized is deprecated, use humanized_assignable_<value>s.humanized instead", caller)
|
|
12
12
|
@humanization
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -1277,9 +1277,17 @@ describe AssignableValues::ActiveRecord do
|
|
|
1277
1277
|
%w[pop rock]
|
|
1278
1278
|
end
|
|
1279
1279
|
end
|
|
1280
|
-
ActiveSupport::Deprecation
|
|
1280
|
+
deprecation_instance = instance_double(ActiveSupport::Deprecation)
|
|
1281
|
+
allow(ActiveSupport::Deprecation).to receive(:new).and_return(deprecation_instance)
|
|
1282
|
+
allow(deprecation_instance).to receive(:warn)
|
|
1283
|
+
|
|
1281
1284
|
genres = klass.new.humanized_genres
|
|
1282
1285
|
genres.collect(&:humanized).should == ['Pop music', 'Rock music']
|
|
1286
|
+
|
|
1287
|
+
expect(deprecation_instance).to have_received(:warn).with(
|
|
1288
|
+
"humanized_<value>s is deprecated, use humanized_assignable_<value>s instead",
|
|
1289
|
+
instance_of(Array)
|
|
1290
|
+
)
|
|
1283
1291
|
end
|
|
1284
1292
|
|
|
1285
1293
|
it "should define a method #humanized on assignable string values, which return up the value's' translation" do
|
|
@@ -1288,8 +1296,16 @@ describe AssignableValues::ActiveRecord do
|
|
|
1288
1296
|
%w[pop rock]
|
|
1289
1297
|
end
|
|
1290
1298
|
end
|
|
1291
|
-
ActiveSupport::Deprecation
|
|
1299
|
+
deprecation_instance = instance_double(ActiveSupport::Deprecation)
|
|
1300
|
+
allow(ActiveSupport::Deprecation).to receive(:new).and_return(deprecation_instance)
|
|
1301
|
+
allow(deprecation_instance).to receive(:warn)
|
|
1302
|
+
|
|
1292
1303
|
klass.new.assignable_genres.collect(&:humanized).should == ['Pop music', 'Rock music']
|
|
1304
|
+
|
|
1305
|
+
expect(deprecation_instance).to have_received(:warn).with(
|
|
1306
|
+
"assignable_<value>.humanized is deprecated, use humanized_assignable_<value>s.humanized instead",
|
|
1307
|
+
instance_of(Array)
|
|
1308
|
+
).at_least(:once)
|
|
1293
1309
|
end
|
|
1294
1310
|
|
|
1295
1311
|
it 'should not define a method #humanized on values that are not strings' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: assignable_values
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henning Koch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -46,6 +46,8 @@ files:
|
|
|
46
46
|
- Gemfile.6.1.pg.lock
|
|
47
47
|
- Gemfile.7.1.pg
|
|
48
48
|
- Gemfile.7.1.pg.lock
|
|
49
|
+
- Gemfile.8.0.pg
|
|
50
|
+
- Gemfile.8.0.pg.lock
|
|
49
51
|
- Gemfile.lock
|
|
50
52
|
- LICENSE
|
|
51
53
|
- README.md
|