assignable_values 1.1.1 → 2.0.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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +40 -39
- data/.ruby-version +1 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/{Gemfile.5.0 → Gemfile.7.1.mysql2} +2 -2
- data/Gemfile.7.1.mysql2.lock +88 -0
- data/Gemfile.7.1.pg.lock +2 -2
- data/{Gemfile.5.1 → Gemfile.7.2.mysql2} +2 -2
- data/Gemfile.7.2.mysql2.lock +90 -0
- data/{Gemfile.6.1.pg → Gemfile.7.2.pg} +1 -1
- data/Gemfile.7.2.pg.lock +89 -0
- data/Gemfile.8.0.mysql2 +16 -0
- data/Gemfile.8.0.mysql2.lock +92 -0
- data/Gemfile.8.0.pg.lock +2 -2
- data/Gemfile.8.1.mysql2 +16 -0
- data/Gemfile.8.1.mysql2.lock +91 -0
- data/{Gemfile.5.1.pg → Gemfile.8.1.pg} +3 -3
- data/Gemfile.8.1.pg.lock +91 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/assignable_values/active_record/restriction/base.rb +0 -11
- data/lib/assignable_values/active_record/restriction/scalar_attribute.rb +0 -19
- data/lib/assignable_values/version.rb +1 -1
- data/lib/assignable_values.rb +0 -1
- data/spec/assignable_values/active_record_spec.rb +0 -52
- data/spec/support/database.rb +5 -1
- metadata +15 -15
- data/Gemfile.5.0.lock +0 -68
- data/Gemfile.5.1.lock +0 -68
- data/Gemfile.5.1.pg.lock +0 -68
- data/Gemfile.6.1.pg.lock +0 -67
- data/lib/assignable_values/humanizable_string.rb +0 -15
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
assignable_values (2.0.0)
|
|
5
|
+
activerecord (>= 2.3)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activemodel (8.1.1)
|
|
11
|
+
activesupport (= 8.1.1)
|
|
12
|
+
activerecord (8.1.1)
|
|
13
|
+
activemodel (= 8.1.1)
|
|
14
|
+
activesupport (= 8.1.1)
|
|
15
|
+
timeout (>= 0.4.0)
|
|
16
|
+
activesupport (8.1.1)
|
|
17
|
+
base64
|
|
18
|
+
bigdecimal
|
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
|
+
connection_pool (>= 2.2.5)
|
|
21
|
+
drb
|
|
22
|
+
i18n (>= 1.6, < 2)
|
|
23
|
+
json
|
|
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.3.0)
|
|
30
|
+
bigdecimal (4.0.1)
|
|
31
|
+
concurrent-ruby (1.3.6)
|
|
32
|
+
connection_pool (3.0.2)
|
|
33
|
+
database_cleaner (2.1.0)
|
|
34
|
+
database_cleaner-active_record (>= 2, < 3)
|
|
35
|
+
database_cleaner-active_record (2.2.2)
|
|
36
|
+
activerecord (>= 5.a)
|
|
37
|
+
database_cleaner-core (~> 2.0)
|
|
38
|
+
database_cleaner-core (2.0.1)
|
|
39
|
+
diff-lcs (1.6.2)
|
|
40
|
+
drb (2.2.3)
|
|
41
|
+
gemika (0.8.4)
|
|
42
|
+
i18n (1.14.7)
|
|
43
|
+
concurrent-ruby (~> 1.0)
|
|
44
|
+
json (2.18.0)
|
|
45
|
+
logger (1.7.0)
|
|
46
|
+
minitest (6.0.0)
|
|
47
|
+
prism (~> 1.5)
|
|
48
|
+
mysql2 (0.5.7)
|
|
49
|
+
bigdecimal
|
|
50
|
+
prism (1.6.0)
|
|
51
|
+
rake (13.3.1)
|
|
52
|
+
rspec (3.13.2)
|
|
53
|
+
rspec-core (~> 3.13.0)
|
|
54
|
+
rspec-expectations (~> 3.13.0)
|
|
55
|
+
rspec-mocks (~> 3.13.0)
|
|
56
|
+
rspec-core (3.13.6)
|
|
57
|
+
rspec-support (~> 3.13.0)
|
|
58
|
+
rspec-expectations (3.13.5)
|
|
59
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
60
|
+
rspec-support (~> 3.13.0)
|
|
61
|
+
rspec-mocks (3.13.7)
|
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
63
|
+
rspec-support (~> 3.13.0)
|
|
64
|
+
rspec-support (3.13.6)
|
|
65
|
+
rspec_candy (0.5.1)
|
|
66
|
+
rspec
|
|
67
|
+
sneaky-save
|
|
68
|
+
securerandom (0.4.1)
|
|
69
|
+
sneaky-save (0.1.3)
|
|
70
|
+
activerecord (>= 3.2.0)
|
|
71
|
+
timeout (0.6.0)
|
|
72
|
+
tzinfo (2.0.6)
|
|
73
|
+
concurrent-ruby (~> 1.0)
|
|
74
|
+
uri (1.1.1)
|
|
75
|
+
|
|
76
|
+
PLATFORMS
|
|
77
|
+
ruby
|
|
78
|
+
|
|
79
|
+
DEPENDENCIES
|
|
80
|
+
activerecord (~> 8.1.0)
|
|
81
|
+
assignable_values!
|
|
82
|
+
database_cleaner
|
|
83
|
+
gemika (~> 0.8.0)
|
|
84
|
+
i18n
|
|
85
|
+
mysql2
|
|
86
|
+
rake
|
|
87
|
+
rspec
|
|
88
|
+
rspec_candy
|
|
89
|
+
|
|
90
|
+
BUNDLED WITH
|
|
91
|
+
2.7.2
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
3
|
# Runtime dependencies
|
|
4
|
-
gem 'activerecord', '~>
|
|
4
|
+
gem 'activerecord', '~>8.1.0'
|
|
5
5
|
gem 'i18n'
|
|
6
|
-
gem 'pg'
|
|
6
|
+
gem 'pg'
|
|
7
7
|
|
|
8
8
|
# Development dependencies
|
|
9
9
|
gem 'rake'
|
|
10
10
|
gem 'database_cleaner'
|
|
11
11
|
gem 'rspec'
|
|
12
12
|
gem 'rspec_candy'
|
|
13
|
-
gem 'gemika'
|
|
13
|
+
gem 'gemika', '~> 0.8.0'
|
|
14
14
|
|
|
15
15
|
# Gem under test
|
|
16
16
|
gem 'assignable_values', :path => '.'
|
data/Gemfile.8.1.pg.lock
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
assignable_values (2.0.0)
|
|
5
|
+
activerecord (>= 2.3)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
activemodel (8.1.1)
|
|
11
|
+
activesupport (= 8.1.1)
|
|
12
|
+
activerecord (8.1.1)
|
|
13
|
+
activemodel (= 8.1.1)
|
|
14
|
+
activesupport (= 8.1.1)
|
|
15
|
+
timeout (>= 0.4.0)
|
|
16
|
+
activesupport (8.1.1)
|
|
17
|
+
base64
|
|
18
|
+
bigdecimal
|
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
|
+
connection_pool (>= 2.2.5)
|
|
21
|
+
drb
|
|
22
|
+
i18n (>= 1.6, < 2)
|
|
23
|
+
json
|
|
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.3.0)
|
|
30
|
+
bigdecimal (4.0.1)
|
|
31
|
+
concurrent-ruby (1.3.6)
|
|
32
|
+
connection_pool (3.0.2)
|
|
33
|
+
database_cleaner (2.1.0)
|
|
34
|
+
database_cleaner-active_record (>= 2, < 3)
|
|
35
|
+
database_cleaner-active_record (2.2.2)
|
|
36
|
+
activerecord (>= 5.a)
|
|
37
|
+
database_cleaner-core (~> 2.0)
|
|
38
|
+
database_cleaner-core (2.0.1)
|
|
39
|
+
diff-lcs (1.6.2)
|
|
40
|
+
drb (2.2.3)
|
|
41
|
+
gemika (0.8.4)
|
|
42
|
+
i18n (1.14.7)
|
|
43
|
+
concurrent-ruby (~> 1.0)
|
|
44
|
+
json (2.18.0)
|
|
45
|
+
logger (1.7.0)
|
|
46
|
+
minitest (6.0.0)
|
|
47
|
+
prism (~> 1.5)
|
|
48
|
+
pg (1.6.2)
|
|
49
|
+
prism (1.6.0)
|
|
50
|
+
rake (13.3.1)
|
|
51
|
+
rspec (3.13.2)
|
|
52
|
+
rspec-core (~> 3.13.0)
|
|
53
|
+
rspec-expectations (~> 3.13.0)
|
|
54
|
+
rspec-mocks (~> 3.13.0)
|
|
55
|
+
rspec-core (3.13.6)
|
|
56
|
+
rspec-support (~> 3.13.0)
|
|
57
|
+
rspec-expectations (3.13.5)
|
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
59
|
+
rspec-support (~> 3.13.0)
|
|
60
|
+
rspec-mocks (3.13.7)
|
|
61
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
62
|
+
rspec-support (~> 3.13.0)
|
|
63
|
+
rspec-support (3.13.6)
|
|
64
|
+
rspec_candy (0.5.1)
|
|
65
|
+
rspec
|
|
66
|
+
sneaky-save
|
|
67
|
+
securerandom (0.4.1)
|
|
68
|
+
sneaky-save (0.1.3)
|
|
69
|
+
activerecord (>= 3.2.0)
|
|
70
|
+
timeout (0.6.0)
|
|
71
|
+
tzinfo (2.0.6)
|
|
72
|
+
concurrent-ruby (~> 1.0)
|
|
73
|
+
uri (1.1.1)
|
|
74
|
+
|
|
75
|
+
PLATFORMS
|
|
76
|
+
ruby
|
|
77
|
+
x86_64-linux
|
|
78
|
+
|
|
79
|
+
DEPENDENCIES
|
|
80
|
+
activerecord (~> 8.1.0)
|
|
81
|
+
assignable_values!
|
|
82
|
+
database_cleaner
|
|
83
|
+
gemika (~> 0.8.0)
|
|
84
|
+
i18n
|
|
85
|
+
pg
|
|
86
|
+
rake
|
|
87
|
+
rspec
|
|
88
|
+
rspec_candy
|
|
89
|
+
|
|
90
|
+
BUNDLED WITH
|
|
91
|
+
2.7.2
|
data/Gemfile.lock
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Gemfile.
|
|
1
|
+
Gemfile.8.1.pg.lock
|
data/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
We carefully enhanced the core enum functionality with small tweaks that are useful for web forms, internationalized applications and common authorization patterns.
|
|
23
23
|
|
|
24
|
-
`assignable_values` is tested with Rails
|
|
24
|
+
`assignable_values` is tested with Rails 6.1, 7.1 and 8.0 on Ruby 2.7 and 3.3.
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
Restricting scalar attributes
|
|
@@ -443,7 +443,7 @@ Development
|
|
|
443
443
|
|
|
444
444
|
There are tests in `spec`. We only accept PRs with tests. To run tests:
|
|
445
445
|
|
|
446
|
-
- Install Ruby
|
|
446
|
+
- Install Ruby 3.4.7
|
|
447
447
|
- Create a local test database `assignable_values_test` in both MySQL and PostgreSQL (see
|
|
448
448
|
`.github/workflows/test.yml` for commands to do so)
|
|
449
449
|
- Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local
|
|
@@ -459,7 +459,7 @@ We recommend to test large changes against multiple versions of Ruby and multipl
|
|
|
459
459
|
|
|
460
460
|
Note that we have configured GitHub Actions to automatically run tests in all supported Ruby versions and dependency sets after each push. We will only merge pull requests after a green GitHub Actions run.
|
|
461
461
|
|
|
462
|
-
I'm very eager to keep this gem
|
|
462
|
+
I'm very eager to keep this gem lightweight and on topic. If you're unsure whether a change would make it into the gem, [talk to me beforehand](mailto:henning.koch@makandra.de).
|
|
463
463
|
|
|
464
464
|
|
|
465
465
|
Credits
|
|
@@ -7,7 +7,6 @@ module AssignableValues
|
|
|
7
7
|
|
|
8
8
|
SUPPORTED_OPTIONS = [
|
|
9
9
|
:allow_blank,
|
|
10
|
-
:decorate,
|
|
11
10
|
:default,
|
|
12
11
|
:include_old_value,
|
|
13
12
|
:message,
|
|
@@ -75,11 +74,6 @@ module AssignableValues
|
|
|
75
74
|
end
|
|
76
75
|
end
|
|
77
76
|
|
|
78
|
-
if options[:decorate]
|
|
79
|
-
current_values = decorate_values(current_values, record.class)
|
|
80
|
-
additional_assignable_values = decorate_values(additional_assignable_values, record.class)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
77
|
if additional_assignable_values.present?
|
|
84
78
|
# will not keep current_values scoped
|
|
85
79
|
additional_assignable_values | current_values
|
|
@@ -159,10 +153,6 @@ module AssignableValues
|
|
|
159
153
|
raise NotImplementedError
|
|
160
154
|
end
|
|
161
155
|
|
|
162
|
-
def decorate_values(values, _klass)
|
|
163
|
-
values
|
|
164
|
-
end
|
|
165
|
-
|
|
166
156
|
def delegate?
|
|
167
157
|
@options.has_key?(:through)
|
|
168
158
|
end
|
|
@@ -242,7 +232,6 @@ module AssignableValues
|
|
|
242
232
|
define_method assignable_values_method do |*args|
|
|
243
233
|
# Ruby 1.8.7 does not support optional block arguments :(
|
|
244
234
|
options = args.first || {}
|
|
245
|
-
options.merge!({:decorate => true})
|
|
246
235
|
restriction.assignable_values(self, options)
|
|
247
236
|
end
|
|
248
237
|
end
|
|
@@ -80,29 +80,10 @@ module AssignableValues
|
|
|
80
80
|
|
|
81
81
|
def define_humanized_assignable_values_instance_method
|
|
82
82
|
restriction = self
|
|
83
|
-
multiple = @options[:multiple]
|
|
84
83
|
enhance_model do
|
|
85
84
|
define_method :"humanized_assignable_#{restriction.property.to_s.pluralize}" do |*args|
|
|
86
85
|
restriction.humanized_assignable_values(self, *args)
|
|
87
86
|
end
|
|
88
|
-
|
|
89
|
-
unless multiple
|
|
90
|
-
define_method :"humanized_#{restriction.property.to_s.pluralize}" do
|
|
91
|
-
ActiveSupport::Deprecation.new.warn("humanized_<value>s is deprecated, use humanized_assignable_<value>s instead", caller)
|
|
92
|
-
restriction.humanized_assignable_values(self)
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
def decorate_values(values, klass)
|
|
99
|
-
restriction = self
|
|
100
|
-
values.collect do |value|
|
|
101
|
-
if value.is_a?(String)
|
|
102
|
-
humanization = restriction.humanized_value(klass, value)
|
|
103
|
-
value = HumanizableString.new(value, humanization)
|
|
104
|
-
end
|
|
105
|
-
value
|
|
106
87
|
end
|
|
107
88
|
end
|
|
108
89
|
|
data/lib/assignable_values.rb
CHANGED
|
@@ -7,4 +7,3 @@ require 'assignable_values/active_record/restriction/belongs_to_association'
|
|
|
7
7
|
require 'assignable_values/active_record/restriction/scalar_attribute'
|
|
8
8
|
require 'assignable_values/active_record/restriction/store_accessor_attribute'
|
|
9
9
|
require 'assignable_values/humanized_value'
|
|
10
|
-
require 'assignable_values/humanizable_string'
|
|
@@ -1269,58 +1269,6 @@ describe AssignableValues::ActiveRecord do
|
|
|
1269
1269
|
|
|
1270
1270
|
end
|
|
1271
1271
|
|
|
1272
|
-
context 'legacy methods for API compatibility' do
|
|
1273
|
-
|
|
1274
|
-
it 'should define a method that return pairs of values and their humanization' do
|
|
1275
|
-
klass = Song.disposable_copy do
|
|
1276
|
-
assignable_values_for :genre do
|
|
1277
|
-
%w[pop rock]
|
|
1278
|
-
end
|
|
1279
|
-
end
|
|
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
|
-
|
|
1284
|
-
genres = klass.new.humanized_genres
|
|
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
|
-
)
|
|
1291
|
-
end
|
|
1292
|
-
|
|
1293
|
-
it "should define a method #humanized on assignable string values, which return up the value's' translation" do
|
|
1294
|
-
klass = Song.disposable_copy do
|
|
1295
|
-
assignable_values_for :genre do
|
|
1296
|
-
%w[pop rock]
|
|
1297
|
-
end
|
|
1298
|
-
end
|
|
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
|
-
|
|
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)
|
|
1309
|
-
end
|
|
1310
|
-
|
|
1311
|
-
it 'should not define a method #humanized on values that are not strings' do
|
|
1312
|
-
klass = Song.disposable_copy do
|
|
1313
|
-
assignable_values_for :year do
|
|
1314
|
-
[1999, 2000, 2001]
|
|
1315
|
-
end
|
|
1316
|
-
end
|
|
1317
|
-
years = klass.new.assignable_years
|
|
1318
|
-
years.should == [1999, 2000, 2001]
|
|
1319
|
-
years.first.should_not respond_to(:humanized)
|
|
1320
|
-
end
|
|
1321
|
-
|
|
1322
|
-
end
|
|
1323
|
-
|
|
1324
1272
|
end
|
|
1325
1273
|
|
|
1326
1274
|
context 'with :through option' do
|
data/spec/support/database.rb
CHANGED
|
@@ -10,7 +10,11 @@ database.rewrite_schema! do
|
|
|
10
10
|
t.string :genre
|
|
11
11
|
t.integer :year
|
|
12
12
|
t.integer :duration
|
|
13
|
-
|
|
13
|
+
if defined?(Mysql2)
|
|
14
|
+
t.string :multi_genres
|
|
15
|
+
else
|
|
16
|
+
t.string :multi_genres, :array => true
|
|
17
|
+
end
|
|
14
18
|
t.json :metadata
|
|
15
19
|
end
|
|
16
20
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: assignable_values
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Henning Koch
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activerecord
|
|
@@ -36,18 +35,22 @@ files:
|
|
|
36
35
|
- ".ruby-version"
|
|
37
36
|
- CHANGELOG.md
|
|
38
37
|
- Gemfile
|
|
39
|
-
- Gemfile.
|
|
40
|
-
- Gemfile.
|
|
41
|
-
- Gemfile.5.1
|
|
42
|
-
- Gemfile.5.1.lock
|
|
43
|
-
- Gemfile.5.1.pg
|
|
44
|
-
- Gemfile.5.1.pg.lock
|
|
45
|
-
- Gemfile.6.1.pg
|
|
46
|
-
- Gemfile.6.1.pg.lock
|
|
38
|
+
- Gemfile.7.1.mysql2
|
|
39
|
+
- Gemfile.7.1.mysql2.lock
|
|
47
40
|
- Gemfile.7.1.pg
|
|
48
41
|
- Gemfile.7.1.pg.lock
|
|
42
|
+
- Gemfile.7.2.mysql2
|
|
43
|
+
- Gemfile.7.2.mysql2.lock
|
|
44
|
+
- Gemfile.7.2.pg
|
|
45
|
+
- Gemfile.7.2.pg.lock
|
|
46
|
+
- Gemfile.8.0.mysql2
|
|
47
|
+
- Gemfile.8.0.mysql2.lock
|
|
49
48
|
- Gemfile.8.0.pg
|
|
50
49
|
- Gemfile.8.0.pg.lock
|
|
50
|
+
- Gemfile.8.1.mysql2
|
|
51
|
+
- Gemfile.8.1.mysql2.lock
|
|
52
|
+
- Gemfile.8.1.pg
|
|
53
|
+
- Gemfile.8.1.pg.lock
|
|
51
54
|
- Gemfile.lock
|
|
52
55
|
- LICENSE
|
|
53
56
|
- README.md
|
|
@@ -60,7 +63,6 @@ files:
|
|
|
60
63
|
- lib/assignable_values/active_record/restriction/scalar_attribute.rb
|
|
61
64
|
- lib/assignable_values/active_record/restriction/store_accessor_attribute.rb
|
|
62
65
|
- lib/assignable_values/errors.rb
|
|
63
|
-
- lib/assignable_values/humanizable_string.rb
|
|
64
66
|
- lib/assignable_values/humanized_value.rb
|
|
65
67
|
- lib/assignable_values/version.rb
|
|
66
68
|
- media/logo.dark.shapes.svg
|
|
@@ -84,7 +86,6 @@ metadata:
|
|
|
84
86
|
bug_tracker_uri: https://github.com/makandra/assignable_values/issues
|
|
85
87
|
changelog_uri: https://github.com/makandra/assignable_values/blob/master/CHANGELOG.md
|
|
86
88
|
rubygems_mfa_required: 'true'
|
|
87
|
-
post_install_message:
|
|
88
89
|
rdoc_options: []
|
|
89
90
|
require_paths:
|
|
90
91
|
- lib
|
|
@@ -99,8 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
99
100
|
- !ruby/object:Gem::Version
|
|
100
101
|
version: '0'
|
|
101
102
|
requirements: []
|
|
102
|
-
rubygems_version:
|
|
103
|
-
signing_key:
|
|
103
|
+
rubygems_version: 4.0.1
|
|
104
104
|
specification_version: 4
|
|
105
105
|
summary: Restrict the values assignable to ActiveRecord attributes or associations
|
|
106
106
|
test_files:
|
data/Gemfile.5.0.lock
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 (5.0.7.2)
|
|
11
|
-
activesupport (= 5.0.7.2)
|
|
12
|
-
activerecord (5.0.7.2)
|
|
13
|
-
activemodel (= 5.0.7.2)
|
|
14
|
-
activesupport (= 5.0.7.2)
|
|
15
|
-
arel (~> 7.0)
|
|
16
|
-
activesupport (5.0.7.2)
|
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
|
-
i18n (>= 0.7, < 2)
|
|
19
|
-
minitest (~> 5.1)
|
|
20
|
-
tzinfo (~> 1.1)
|
|
21
|
-
arel (7.1.4)
|
|
22
|
-
concurrent-ruby (1.1.7)
|
|
23
|
-
database_cleaner (1.8.5)
|
|
24
|
-
diff-lcs (1.4.4)
|
|
25
|
-
gemika (0.7.1)
|
|
26
|
-
i18n (1.8.5)
|
|
27
|
-
concurrent-ruby (~> 1.0)
|
|
28
|
-
minitest (5.14.2)
|
|
29
|
-
mysql2 (0.5.3)
|
|
30
|
-
rake (13.0.1)
|
|
31
|
-
rspec (3.10.0)
|
|
32
|
-
rspec-core (~> 3.10.0)
|
|
33
|
-
rspec-expectations (~> 3.10.0)
|
|
34
|
-
rspec-mocks (~> 3.10.0)
|
|
35
|
-
rspec-core (3.10.0)
|
|
36
|
-
rspec-support (~> 3.10.0)
|
|
37
|
-
rspec-expectations (3.10.0)
|
|
38
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.10.0)
|
|
40
|
-
rspec-mocks (3.10.0)
|
|
41
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
-
rspec-support (~> 3.10.0)
|
|
43
|
-
rspec-support (3.10.0)
|
|
44
|
-
rspec_candy (0.5.1)
|
|
45
|
-
rspec
|
|
46
|
-
sneaky-save
|
|
47
|
-
sneaky-save (0.1.3)
|
|
48
|
-
activerecord (>= 3.2.0)
|
|
49
|
-
thread_safe (0.3.6)
|
|
50
|
-
tzinfo (1.2.7)
|
|
51
|
-
thread_safe (~> 0.1)
|
|
52
|
-
|
|
53
|
-
PLATFORMS
|
|
54
|
-
ruby
|
|
55
|
-
|
|
56
|
-
DEPENDENCIES
|
|
57
|
-
activerecord (~> 5.0.0)
|
|
58
|
-
assignable_values!
|
|
59
|
-
database_cleaner
|
|
60
|
-
gemika
|
|
61
|
-
i18n
|
|
62
|
-
mysql2
|
|
63
|
-
rake
|
|
64
|
-
rspec
|
|
65
|
-
rspec_candy
|
|
66
|
-
|
|
67
|
-
BUNDLED WITH
|
|
68
|
-
2.1.4
|
data/Gemfile.5.1.lock
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 (5.1.7)
|
|
11
|
-
activesupport (= 5.1.7)
|
|
12
|
-
activerecord (5.1.7)
|
|
13
|
-
activemodel (= 5.1.7)
|
|
14
|
-
activesupport (= 5.1.7)
|
|
15
|
-
arel (~> 8.0)
|
|
16
|
-
activesupport (5.1.7)
|
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
|
-
i18n (>= 0.7, < 2)
|
|
19
|
-
minitest (~> 5.1)
|
|
20
|
-
tzinfo (~> 1.1)
|
|
21
|
-
arel (8.0.0)
|
|
22
|
-
concurrent-ruby (1.1.7)
|
|
23
|
-
database_cleaner (1.8.5)
|
|
24
|
-
diff-lcs (1.4.4)
|
|
25
|
-
gemika (0.7.1)
|
|
26
|
-
i18n (1.8.5)
|
|
27
|
-
concurrent-ruby (~> 1.0)
|
|
28
|
-
minitest (5.14.2)
|
|
29
|
-
mysql2 (0.5.3)
|
|
30
|
-
rake (13.0.1)
|
|
31
|
-
rspec (3.10.0)
|
|
32
|
-
rspec-core (~> 3.10.0)
|
|
33
|
-
rspec-expectations (~> 3.10.0)
|
|
34
|
-
rspec-mocks (~> 3.10.0)
|
|
35
|
-
rspec-core (3.10.0)
|
|
36
|
-
rspec-support (~> 3.10.0)
|
|
37
|
-
rspec-expectations (3.10.0)
|
|
38
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.10.0)
|
|
40
|
-
rspec-mocks (3.10.0)
|
|
41
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
-
rspec-support (~> 3.10.0)
|
|
43
|
-
rspec-support (3.10.0)
|
|
44
|
-
rspec_candy (0.5.1)
|
|
45
|
-
rspec
|
|
46
|
-
sneaky-save
|
|
47
|
-
sneaky-save (0.1.3)
|
|
48
|
-
activerecord (>= 3.2.0)
|
|
49
|
-
thread_safe (0.3.6)
|
|
50
|
-
tzinfo (1.2.7)
|
|
51
|
-
thread_safe (~> 0.1)
|
|
52
|
-
|
|
53
|
-
PLATFORMS
|
|
54
|
-
ruby
|
|
55
|
-
|
|
56
|
-
DEPENDENCIES
|
|
57
|
-
activerecord (~> 5.1.0)
|
|
58
|
-
assignable_values!
|
|
59
|
-
database_cleaner
|
|
60
|
-
gemika
|
|
61
|
-
i18n
|
|
62
|
-
mysql2
|
|
63
|
-
rake
|
|
64
|
-
rspec
|
|
65
|
-
rspec_candy
|
|
66
|
-
|
|
67
|
-
BUNDLED WITH
|
|
68
|
-
2.1.4
|
data/Gemfile.5.1.pg.lock
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
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 (5.1.4)
|
|
11
|
-
activesupport (= 5.1.4)
|
|
12
|
-
activerecord (5.1.4)
|
|
13
|
-
activemodel (= 5.1.4)
|
|
14
|
-
activesupport (= 5.1.4)
|
|
15
|
-
arel (~> 8.0)
|
|
16
|
-
activesupport (5.1.4)
|
|
17
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
|
-
i18n (~> 0.7)
|
|
19
|
-
minitest (~> 5.1)
|
|
20
|
-
tzinfo (~> 1.1)
|
|
21
|
-
arel (8.0.0)
|
|
22
|
-
concurrent-ruby (1.0.5)
|
|
23
|
-
database_cleaner (1.6.1)
|
|
24
|
-
diff-lcs (1.3)
|
|
25
|
-
gemika (0.7.1)
|
|
26
|
-
i18n (0.9.0)
|
|
27
|
-
concurrent-ruby (~> 1.0)
|
|
28
|
-
minitest (5.10.3)
|
|
29
|
-
pg (0.21.0)
|
|
30
|
-
rake (12.1.0)
|
|
31
|
-
rspec (3.7.0)
|
|
32
|
-
rspec-core (~> 3.7.0)
|
|
33
|
-
rspec-expectations (~> 3.7.0)
|
|
34
|
-
rspec-mocks (~> 3.7.0)
|
|
35
|
-
rspec-core (3.7.0)
|
|
36
|
-
rspec-support (~> 3.7.0)
|
|
37
|
-
rspec-expectations (3.7.0)
|
|
38
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.7.0)
|
|
40
|
-
rspec-mocks (3.7.0)
|
|
41
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
-
rspec-support (~> 3.7.0)
|
|
43
|
-
rspec-support (3.7.0)
|
|
44
|
-
rspec_candy (0.4.1)
|
|
45
|
-
rspec
|
|
46
|
-
sneaky-save
|
|
47
|
-
sneaky-save (0.1.2)
|
|
48
|
-
activerecord (>= 3.2.0)
|
|
49
|
-
thread_safe (0.3.6)
|
|
50
|
-
tzinfo (1.2.3)
|
|
51
|
-
thread_safe (~> 0.1)
|
|
52
|
-
|
|
53
|
-
PLATFORMS
|
|
54
|
-
ruby
|
|
55
|
-
|
|
56
|
-
DEPENDENCIES
|
|
57
|
-
activerecord (~> 5.1.0)
|
|
58
|
-
assignable_values!
|
|
59
|
-
database_cleaner
|
|
60
|
-
gemika
|
|
61
|
-
i18n
|
|
62
|
-
pg (< 1)
|
|
63
|
-
rake
|
|
64
|
-
rspec
|
|
65
|
-
rspec_candy
|
|
66
|
-
|
|
67
|
-
BUNDLED WITH
|
|
68
|
-
2.1.4
|