assignable_values 0.16.4 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +94 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +27 -0
- data/Gemfile +1 -1
- data/Gemfile.5.0.lock +33 -32
- data/Gemfile.5.1.lock +31 -31
- data/Gemfile.5.1.pg.lock +3 -3
- data/{Gemfile.6.0.pg → Gemfile.6.1.pg} +2 -2
- data/{Gemfile.6.0.pg.lock → Gemfile.6.1.pg.lock} +20 -21
- data/{Gemfile.4.2 → Gemfile.7.0.pg} +4 -4
- data/Gemfile.7.0.pg.lock +65 -0
- data/Gemfile.lock +1 -1
- data/README.md +23 -5
- data/assignable_values.gemspec +8 -0
- data/lib/assignable_values/active_record/restriction/base.rb +5 -5
- data/lib/assignable_values/active_record/restriction/scalar_attribute.rb +16 -11
- data/lib/assignable_values/version.rb +1 -1
- data/spec/assignable_values/active_record_spec.rb +59 -5
- data/spec/support/database.github.yml +13 -0
- data/spec/support/i18n.yml +7 -2
- metadata +14 -15
- data/.travis.yml +0 -81
- data/Gemfile.2.3 +0 -16
- data/Gemfile.2.3.lock +0 -40
- data/Gemfile.3.2 +0 -16
- data/Gemfile.3.2.lock +0 -65
- data/Gemfile.4.2.lock +0 -70
- data/spec/support/database.travis.yml +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8059afed1809ca7277b0db60d77f076f92746d3558bf06ed1713feb6961b053e
|
4
|
+
data.tar.gz: 11c933835b82953cc8576c99f23eebf6d686406be75a8566e27a067bb8dd0686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aa60676ebd5d1d21d6b64b0f1df342d3e1cafc540671d0321ed3f0d599b57a5b982d3a736d6b2922c263af5bb362da0e4ffecdb438ec5c547e755ecd36e6c4b
|
7
|
+
data.tar.gz: b67a535cb382ffe4f1996b919fc91440a97e758a839d87be98b6df50bffdb6bbf258b733fbceae5c888f05eecfe2327adc41690e101dc6e8a02c9220b4779386
|
@@ -0,0 +1,94 @@
|
|
1
|
+
---
|
2
|
+
name: Tests
|
3
|
+
'on':
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
jobs:
|
11
|
+
test_mysql:
|
12
|
+
runs-on: ubuntu-20.04
|
13
|
+
services:
|
14
|
+
mysql:
|
15
|
+
image: mysql:5.6
|
16
|
+
env:
|
17
|
+
MYSQL_ROOT_PASSWORD: password
|
18
|
+
ports:
|
19
|
+
- 3306:3306
|
20
|
+
options: >-
|
21
|
+
--health-cmd="mysqladmin ping"
|
22
|
+
--health-interval=10s
|
23
|
+
--health-timeout=5s
|
24
|
+
--health-retries=3
|
25
|
+
strategy:
|
26
|
+
fail-fast: false
|
27
|
+
matrix:
|
28
|
+
include:
|
29
|
+
- ruby: 2.5.3
|
30
|
+
gemfile: Gemfile.5.0
|
31
|
+
- ruby: 2.5.3
|
32
|
+
gemfile: Gemfile.5.1
|
33
|
+
env:
|
34
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v2
|
37
|
+
- name: Install ruby
|
38
|
+
uses: ruby/setup-ruby@v1
|
39
|
+
with:
|
40
|
+
ruby-version: "${{ matrix.ruby }}"
|
41
|
+
- name: Bundle
|
42
|
+
run: |
|
43
|
+
gem install bundler:2.1.4
|
44
|
+
bundle install --no-deployment
|
45
|
+
- name: Setup databases
|
46
|
+
run: |
|
47
|
+
mysql -e 'create database IF NOT EXISTS assignable_values_test;' -u root --password=password -P 3306 -h 127.0.0.1
|
48
|
+
- name: Run tests
|
49
|
+
run: bundle exec rspec
|
50
|
+
test_pg:
|
51
|
+
runs-on: ubuntu-20.04
|
52
|
+
services:
|
53
|
+
postgres:
|
54
|
+
image: postgres
|
55
|
+
env:
|
56
|
+
POSTGRES_PASSWORD: postgres
|
57
|
+
options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s
|
58
|
+
--health-retries 5"
|
59
|
+
ports:
|
60
|
+
- 5432:5432
|
61
|
+
strategy:
|
62
|
+
fail-fast: false
|
63
|
+
matrix:
|
64
|
+
include:
|
65
|
+
- ruby: 2.5.3
|
66
|
+
gemfile: Gemfile.5.1.pg
|
67
|
+
- ruby: 2.5.3
|
68
|
+
gemfile: Gemfile.6.1.pg
|
69
|
+
- ruby: 2.7.3
|
70
|
+
gemfile: Gemfile.6.1.pg
|
71
|
+
- ruby: 2.7.3
|
72
|
+
gemfile: Gemfile.7.0.pg
|
73
|
+
- ruby: 3.0.1
|
74
|
+
gemfile: Gemfile.6.1.pg
|
75
|
+
- ruby: 3.0.1
|
76
|
+
gemfile: Gemfile.7.0.pg
|
77
|
+
env:
|
78
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
79
|
+
steps:
|
80
|
+
- uses: actions/checkout@v2
|
81
|
+
- name: Install ruby
|
82
|
+
uses: ruby/setup-ruby@v1
|
83
|
+
with:
|
84
|
+
ruby-version: "${{ matrix.ruby }}"
|
85
|
+
- name: Setup database
|
86
|
+
run: |
|
87
|
+
sudo apt-get install -y postgresql-client
|
88
|
+
PGPASSWORD=postgres psql -c 'create database assignable_values_test;' -U postgres -p 5432 -h localhost
|
89
|
+
- name: Bundle
|
90
|
+
run: |
|
91
|
+
gem install bundler:2.1.4
|
92
|
+
bundle install --no-deployment
|
93
|
+
- name: Run tests
|
94
|
+
run: bundle exec rspec
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.1
|
data/CHANGELOG.md
CHANGED
@@ -6,8 +6,35 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
6
6
|
|
7
7
|
### Breaking changes
|
8
8
|
|
9
|
+
-
|
10
|
+
|
11
|
+
### Compatible changes
|
12
|
+
|
13
|
+
-
|
14
|
+
|
15
|
+
## 0.17.0 - 2022-07-27
|
16
|
+
|
9
17
|
### Compatible changes
|
10
18
|
|
19
|
+
- Allow to override humanization for inherited assignable_values
|
20
|
+
|
21
|
+
## 0.16.6 - 2022-03-16
|
22
|
+
|
23
|
+
### Breaking changes
|
24
|
+
|
25
|
+
- Remove no longer supported ruby versions (2.3.8, 2.4.2)
|
26
|
+
- Activate rubygems MFA
|
27
|
+
|
28
|
+
### Compatible changes
|
29
|
+
|
30
|
+
- test against ActiveRecord 7.0
|
31
|
+
|
32
|
+
## 0.16.5 - 2021-01-10
|
33
|
+
|
34
|
+
### Compatible changes
|
35
|
+
|
36
|
+
- Previously assigned values are no longer duplicated when calling the assignable_values method (fixes #32)
|
37
|
+
|
11
38
|
## 0.16.4 - 2020-10-15
|
12
39
|
|
13
40
|
### Compatible changes
|
data/Gemfile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
./Gemfile.
|
1
|
+
./Gemfile.7.0.pg
|
data/Gemfile.5.0.lock
CHANGED
@@ -1,52 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
assignable_values (0.
|
4
|
+
assignable_values (0.17.0)
|
5
5
|
activerecord (>= 2.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (5.0.
|
11
|
-
activesupport (= 5.0.
|
12
|
-
activerecord (5.0.
|
13
|
-
activemodel (= 5.0.
|
14
|
-
activesupport (= 5.0.
|
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
15
|
arel (~> 7.0)
|
16
|
-
activesupport (5.0.
|
16
|
+
activesupport (5.0.7.2)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (
|
18
|
+
i18n (>= 0.7, < 2)
|
19
19
|
minitest (~> 5.1)
|
20
20
|
tzinfo (~> 1.1)
|
21
21
|
arel (7.1.4)
|
22
|
-
concurrent-ruby (1.
|
23
|
-
database_cleaner (1.5
|
24
|
-
diff-lcs (1.
|
25
|
-
gemika (0.
|
26
|
-
i18n (
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
rspec-
|
33
|
-
rspec-
|
34
|
-
|
35
|
-
|
36
|
-
|
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)
|
37
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-mocks (3.10.0)
|
40
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
43
|
-
rspec_candy (0.
|
42
|
+
rspec-support (~> 3.10.0)
|
43
|
+
rspec-support (3.10.0)
|
44
|
+
rspec_candy (0.5.1)
|
44
45
|
rspec
|
45
46
|
sneaky-save
|
46
|
-
sneaky-save (0.1.
|
47
|
+
sneaky-save (0.1.3)
|
47
48
|
activerecord (>= 3.2.0)
|
48
|
-
thread_safe (0.3.
|
49
|
-
tzinfo (1.2.
|
49
|
+
thread_safe (0.3.6)
|
50
|
+
tzinfo (1.2.7)
|
50
51
|
thread_safe (~> 0.1)
|
51
52
|
|
52
53
|
PLATFORMS
|
@@ -64,4 +65,4 @@ DEPENDENCIES
|
|
64
65
|
rspec_candy
|
65
66
|
|
66
67
|
BUNDLED WITH
|
67
|
-
1.
|
68
|
+
2.1.4
|
data/Gemfile.5.1.lock
CHANGED
@@ -1,53 +1,53 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
assignable_values (0.
|
4
|
+
assignable_values (0.17.0)
|
5
5
|
activerecord (>= 2.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (5.1.
|
11
|
-
activesupport (= 5.1.
|
12
|
-
activerecord (5.1.
|
13
|
-
activemodel (= 5.1.
|
14
|
-
activesupport (= 5.1.
|
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
15
|
arel (~> 8.0)
|
16
|
-
activesupport (5.1.
|
16
|
+
activesupport (5.1.7)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
|
-
i18n (
|
18
|
+
i18n (>= 0.7, < 2)
|
19
19
|
minitest (~> 5.1)
|
20
20
|
tzinfo (~> 1.1)
|
21
21
|
arel (8.0.0)
|
22
|
-
concurrent-ruby (1.
|
23
|
-
database_cleaner (1.
|
24
|
-
diff-lcs (1.
|
25
|
-
gemika (0.
|
26
|
-
i18n (
|
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
27
|
concurrent-ruby (~> 1.0)
|
28
|
-
minitest (5.
|
29
|
-
mysql2 (0.
|
30
|
-
rake (
|
31
|
-
rspec (3.
|
32
|
-
rspec-core (~> 3.
|
33
|
-
rspec-expectations (~> 3.
|
34
|
-
rspec-mocks (~> 3.
|
35
|
-
rspec-core (3.
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-expectations (3.
|
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
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
-
rspec-support (~> 3.
|
40
|
-
rspec-mocks (3.
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-mocks (3.10.0)
|
41
41
|
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
-
rspec-support (~> 3.
|
43
|
-
rspec-support (3.
|
44
|
-
rspec_candy (0.
|
42
|
+
rspec-support (~> 3.10.0)
|
43
|
+
rspec-support (3.10.0)
|
44
|
+
rspec_candy (0.5.1)
|
45
45
|
rspec
|
46
46
|
sneaky-save
|
47
|
-
sneaky-save (0.1.
|
47
|
+
sneaky-save (0.1.3)
|
48
48
|
activerecord (>= 3.2.0)
|
49
49
|
thread_safe (0.3.6)
|
50
|
-
tzinfo (1.2.
|
50
|
+
tzinfo (1.2.7)
|
51
51
|
thread_safe (~> 0.1)
|
52
52
|
|
53
53
|
PLATFORMS
|
@@ -65,4 +65,4 @@ DEPENDENCIES
|
|
65
65
|
rspec_candy
|
66
66
|
|
67
67
|
BUNDLED WITH
|
68
|
-
1.
|
68
|
+
2.1.4
|
data/Gemfile.5.1.pg.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
assignable_values (0.
|
4
|
+
assignable_values (0.17.0)
|
5
5
|
activerecord (>= 2.3)
|
6
6
|
|
7
7
|
GEM
|
@@ -22,7 +22,7 @@ GEM
|
|
22
22
|
concurrent-ruby (1.0.5)
|
23
23
|
database_cleaner (1.6.1)
|
24
24
|
diff-lcs (1.3)
|
25
|
-
gemika (0.
|
25
|
+
gemika (0.7.1)
|
26
26
|
i18n (0.9.0)
|
27
27
|
concurrent-ruby (~> 1.0)
|
28
28
|
minitest (5.10.3)
|
@@ -65,4 +65,4 @@ DEPENDENCIES
|
|
65
65
|
rspec_candy
|
66
66
|
|
67
67
|
BUNDLED WITH
|
68
|
-
1.
|
68
|
+
2.1.4
|
@@ -1,31 +1,31 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
assignable_values (0.
|
4
|
+
assignable_values (0.17.0)
|
5
5
|
activerecord (>= 2.3)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (6.
|
11
|
-
activesupport (= 6.
|
12
|
-
activerecord (6.
|
13
|
-
activemodel (= 6.
|
14
|
-
activesupport (= 6.
|
15
|
-
activesupport (6.
|
10
|
+
activemodel (6.1.3.2)
|
11
|
+
activesupport (= 6.1.3.2)
|
12
|
+
activerecord (6.1.3.2)
|
13
|
+
activemodel (= 6.1.3.2)
|
14
|
+
activesupport (= 6.1.3.2)
|
15
|
+
activesupport (6.1.3.2)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
-
i18n (>=
|
18
|
-
minitest (
|
19
|
-
tzinfo (~>
|
20
|
-
zeitwerk (~> 2.
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
21
|
concurrent-ruby (1.1.5)
|
22
22
|
database_cleaner (1.7.0)
|
23
23
|
diff-lcs (1.3)
|
24
|
-
gemika (0.
|
24
|
+
gemika (0.7.1)
|
25
25
|
i18n (1.6.0)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
minitest (5.
|
28
|
-
pg (
|
27
|
+
minitest (5.14.4)
|
28
|
+
pg (1.1.0)
|
29
29
|
rake (12.3.2)
|
30
30
|
rspec (3.8.0)
|
31
31
|
rspec-core (~> 3.8.0)
|
@@ -45,24 +45,23 @@ GEM
|
|
45
45
|
sneaky-save
|
46
46
|
sneaky-save (0.1.3)
|
47
47
|
activerecord (>= 3.2.0)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
zeitwerk (2.1.9)
|
48
|
+
tzinfo (2.0.4)
|
49
|
+
concurrent-ruby (~> 1.0)
|
50
|
+
zeitwerk (2.4.2)
|
52
51
|
|
53
52
|
PLATFORMS
|
54
53
|
ruby
|
55
54
|
|
56
55
|
DEPENDENCIES
|
57
|
-
activerecord (~> 6.
|
56
|
+
activerecord (~> 6.1.3)
|
58
57
|
assignable_values!
|
59
58
|
database_cleaner
|
60
59
|
gemika
|
61
60
|
i18n
|
62
|
-
pg (
|
61
|
+
pg (= 1.1)
|
63
62
|
rake
|
64
63
|
rspec
|
65
64
|
rspec_candy
|
66
65
|
|
67
66
|
BUNDLED WITH
|
68
|
-
|
67
|
+
2.2.15
|
@@ -1,14 +1,14 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
# Runtime dependencies
|
4
|
-
gem 'activerecord', '~>
|
5
|
-
gem 'i18n'
|
6
|
-
gem '
|
4
|
+
gem 'activerecord', '~>7.0.0'
|
5
|
+
gem 'i18n'
|
6
|
+
gem 'pg', '1.1'
|
7
7
|
|
8
8
|
# Development dependencies
|
9
9
|
gem 'rake'
|
10
10
|
gem 'database_cleaner'
|
11
|
-
gem 'rspec'
|
11
|
+
gem 'rspec'
|
12
12
|
gem 'rspec_candy'
|
13
13
|
gem 'gemika'
|
14
14
|
|
data/Gemfile.7.0.pg.lock
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
assignable_values (0.17.0)
|
5
|
+
activerecord (>= 2.3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (7.0.0)
|
11
|
+
activesupport (= 7.0.0)
|
12
|
+
activerecord (7.0.0)
|
13
|
+
activemodel (= 7.0.0)
|
14
|
+
activesupport (= 7.0.0)
|
15
|
+
activesupport (7.0.0)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
concurrent-ruby (1.1.5)
|
21
|
+
database_cleaner (1.7.0)
|
22
|
+
diff-lcs (1.3)
|
23
|
+
gemika (0.7.1)
|
24
|
+
i18n (1.6.0)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
minitest (5.15.0)
|
27
|
+
pg (1.1.0)
|
28
|
+
rake (12.3.2)
|
29
|
+
rspec (3.8.0)
|
30
|
+
rspec-core (~> 3.8.0)
|
31
|
+
rspec-expectations (~> 3.8.0)
|
32
|
+
rspec-mocks (~> 3.8.0)
|
33
|
+
rspec-core (3.8.0)
|
34
|
+
rspec-support (~> 3.8.0)
|
35
|
+
rspec-expectations (3.8.2)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.8.0)
|
38
|
+
rspec-mocks (3.8.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.8.0)
|
41
|
+
rspec-support (3.8.0)
|
42
|
+
rspec_candy (0.5.1)
|
43
|
+
rspec
|
44
|
+
sneaky-save
|
45
|
+
sneaky-save (0.1.3)
|
46
|
+
activerecord (>= 3.2.0)
|
47
|
+
tzinfo (2.0.4)
|
48
|
+
concurrent-ruby (~> 1.0)
|
49
|
+
|
50
|
+
PLATFORMS
|
51
|
+
ruby
|
52
|
+
|
53
|
+
DEPENDENCIES
|
54
|
+
activerecord (~> 7.0.0)
|
55
|
+
assignable_values!
|
56
|
+
database_cleaner
|
57
|
+
gemika
|
58
|
+
i18n
|
59
|
+
pg (= 1.1)
|
60
|
+
rake
|
61
|
+
rspec
|
62
|
+
rspec_candy
|
63
|
+
|
64
|
+
BUNDLED WITH
|
65
|
+
2.2.15
|
data/Gemfile.lock
CHANGED
@@ -1 +1 @@
|
|
1
|
-
./Gemfile.
|
1
|
+
./Gemfile.7.0.pg.lock
|
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
assignable_values - Enums on vitamins [![
|
1
|
+
assignable_values - Enums on vitamins [![Tests](https://github.com/makandra/assignable_values/workflows/Tests/badge.svg)](https://github.com/makandra/assignable_values/actions)
|
2
2
|
=====================================
|
3
3
|
|
4
4
|
`assignable_values` lets you restrict the values that can be assigned to attributes or associations of ActiveRecord models. You can think of it as enums where the list of allowed values is generated at runtime and the value is checked during validation.
|
5
5
|
|
6
6
|
We carefully enhanced the core enum functionality with small tweaks that are useful for web forms, internationalized applications and common authorization patterns.
|
7
7
|
|
8
|
-
`assignable_values` is tested with Rails
|
8
|
+
`assignable_values` is tested with Rails 5.1 and 6.1 on Ruby 2.5, 2.7 and 3.0.
|
9
9
|
|
10
10
|
|
11
11
|
Restricting scalar attributes
|
@@ -73,6 +73,24 @@ A good way to populate a `<select>` tag with pairs of internal values and human
|
|
73
73
|
|
74
74
|
form.collection_select :genre, form.object.humanized_assignable_genres, :value, :humanized
|
75
75
|
|
76
|
+
#### Humanized labels and inheritance
|
77
|
+
|
78
|
+
For models that inherit assignable values you can override the humanized labels:
|
79
|
+
|
80
|
+
class FunnySong < Song
|
81
|
+
...
|
82
|
+
end
|
83
|
+
|
84
|
+
en:
|
85
|
+
assignable_values:
|
86
|
+
funny_song:
|
87
|
+
genre:
|
88
|
+
pop: 'The stuff you hear on mainstream radio all day long'
|
89
|
+
rock: 'A lot of electric guitars and drums'
|
90
|
+
electronic: 'Whatever David Guetta does'
|
91
|
+
|
92
|
+
If no humanization is provided for the child model (i.e. the `funny_song.genre` key) humanization will fall back to the
|
93
|
+
parent model (`song`).
|
76
94
|
|
77
95
|
### Defining default values
|
78
96
|
|
@@ -351,19 +369,19 @@ There are tests in `spec`. We only accept PRs with tests. To run tests:
|
|
351
369
|
|
352
370
|
- Install Ruby 2.3.8
|
353
371
|
- Create a local test database `assignable_values_test` in both MySQL and PostgreSQL (see
|
354
|
-
`.
|
372
|
+
`.github/workflows/test.yml` for commands to do so)
|
355
373
|
- Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local
|
356
374
|
credentials for the test databases (postgres entry is not required if you are using a socket
|
357
375
|
connection)
|
358
376
|
- Install development dependencies using `bundle install`
|
359
377
|
- Run tests using `bundle exec rake current_rspec`
|
360
378
|
|
361
|
-
We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.
|
379
|
+
We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.github/workflows/test.yml`. We provide some rake tasks to help with this:
|
362
380
|
|
363
381
|
- Install development dependencies using `bundle exec rake matrix:install`
|
364
382
|
- Run tests using `bundle exec rake matrix:spec`
|
365
383
|
|
366
|
-
Note that we have configured
|
384
|
+
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.
|
367
385
|
|
368
386
|
I'm very eager to keep this gem leightweight 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).
|
369
387
|
|
data/assignable_values.gemspec
CHANGED
@@ -11,6 +11,14 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.description = s.summary
|
12
12
|
s.license = 'MIT'
|
13
13
|
|
14
|
+
if RUBY_VERSION.to_f >= 2.0
|
15
|
+
s.metadata = {
|
16
|
+
'bug_tracker_uri' => 'https://github.com/makandra/assignable_values/issues',
|
17
|
+
'changelog_uri' => 'https://github.com/makandra/assignable_values/blob/master/CHANGELOG.md',
|
18
|
+
'rubygems_mfa_required' => 'true',
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
14
22
|
s.files = `git ls-files`.split($\)
|
15
23
|
s.test_files = s.files.grep(%r{^spec/})
|
16
24
|
s.require_paths = ["lib"]
|
@@ -55,7 +55,7 @@ module AssignableValues
|
|
55
55
|
old_value = previously_saved_value(record)
|
56
56
|
if @options[:multiple]
|
57
57
|
if old_value.is_a?(Array)
|
58
|
-
additional_assignable_values
|
58
|
+
additional_assignable_values = old_value
|
59
59
|
end
|
60
60
|
elsif !old_value.blank? && !current_values.include?(old_value)
|
61
61
|
additional_assignable_values << old_value
|
@@ -63,13 +63,13 @@ module AssignableValues
|
|
63
63
|
end
|
64
64
|
|
65
65
|
if options[:decorate]
|
66
|
-
current_values = decorate_values(current_values)
|
67
|
-
additional_assignable_values = decorate_values(additional_assignable_values)
|
66
|
+
current_values = decorate_values(current_values, record.class)
|
67
|
+
additional_assignable_values = decorate_values(additional_assignable_values, record.class)
|
68
68
|
end
|
69
69
|
|
70
70
|
if additional_assignable_values.present?
|
71
71
|
# will not keep current_values scoped
|
72
|
-
additional_assignable_values
|
72
|
+
additional_assignable_values | current_values
|
73
73
|
else
|
74
74
|
current_values
|
75
75
|
end
|
@@ -146,7 +146,7 @@ module AssignableValues
|
|
146
146
|
raise NotImplementedError
|
147
147
|
end
|
148
148
|
|
149
|
-
def decorate_values(values)
|
149
|
+
def decorate_values(values, _klass)
|
150
150
|
values
|
151
151
|
end
|
152
152
|
|
@@ -10,22 +10,29 @@ module AssignableValues
|
|
10
10
|
define_humanized_assignable_values_instance_method
|
11
11
|
end
|
12
12
|
|
13
|
-
def humanized_value(value)
|
13
|
+
def humanized_value(klass, value)
|
14
14
|
if value.present?
|
15
|
-
|
16
|
-
I18n.t(value, :scope => dictionary_scope, :default => default_humanization_for_value(value))
|
15
|
+
humanization_from_i18n(klass, value) || default_humanization_for_value(value)
|
17
16
|
end
|
18
17
|
end
|
19
18
|
|
20
19
|
def humanized_assignable_values(record, options = {})
|
21
20
|
values = assignable_values(record, options)
|
22
21
|
values.collect do |value|
|
23
|
-
HumanizedValue.new(value, humanized_value(value))
|
22
|
+
HumanizedValue.new(value, humanized_value(record.class, value))
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
27
26
|
private
|
28
27
|
|
28
|
+
def humanization_from_i18n(klass, value)
|
29
|
+
klass.lookup_ancestors.select(&:name).find do |klass|
|
30
|
+
dictionary_scope = :"assignable_values.#{klass.model_name.i18n_key}.#{property}"
|
31
|
+
translation = I18n.translate(value, scope: dictionary_scope, default: nil)
|
32
|
+
break translation unless translation.nil?
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
29
36
|
def default_humanization_for_value(value)
|
30
37
|
if value.is_a?(String)
|
31
38
|
value.humanize
|
@@ -38,7 +45,7 @@ module AssignableValues
|
|
38
45
|
restriction = self
|
39
46
|
enhance_model_singleton do
|
40
47
|
define_method :"humanized_#{restriction.property.to_s.singularize}" do |given_value|
|
41
|
-
restriction.humanized_value(given_value)
|
48
|
+
restriction.humanized_value(self, given_value)
|
42
49
|
end
|
43
50
|
end
|
44
51
|
end
|
@@ -53,7 +60,7 @@ module AssignableValues
|
|
53
60
|
end
|
54
61
|
given_value = args[0]
|
55
62
|
value = given_value || send(restriction.property)
|
56
|
-
restriction.humanized_value(value)
|
63
|
+
restriction.humanized_value(self.class, value)
|
57
64
|
end
|
58
65
|
|
59
66
|
if multiple
|
@@ -61,7 +68,7 @@ module AssignableValues
|
|
61
68
|
values = send(restriction.property)
|
62
69
|
if values.respond_to?(:map)
|
63
70
|
values.map do |value|
|
64
|
-
restriction.humanized_value(value)
|
71
|
+
restriction.humanized_value(self.class, value)
|
65
72
|
end
|
66
73
|
else
|
67
74
|
values
|
@@ -88,11 +95,11 @@ module AssignableValues
|
|
88
95
|
end
|
89
96
|
end
|
90
97
|
|
91
|
-
def decorate_values(values)
|
98
|
+
def decorate_values(values, klass)
|
92
99
|
restriction = self
|
93
100
|
values.collect do |value|
|
94
101
|
if value.is_a?(String)
|
95
|
-
humanization = restriction.humanized_value(value)
|
102
|
+
humanization = restriction.humanized_value(klass, value)
|
96
103
|
value = HumanizableString.new(value, humanization)
|
97
104
|
end
|
98
105
|
value
|
@@ -111,8 +118,6 @@ module AssignableValues
|
|
111
118
|
value_was(record)
|
112
119
|
end
|
113
120
|
|
114
|
-
private
|
115
|
-
|
116
121
|
def value_was(record)
|
117
122
|
if record.respond_to?(:attribute_in_database)
|
118
123
|
record.attribute_in_database(:"#{property}") # Rails >= 5.1
|
@@ -53,6 +53,20 @@ describe AssignableValues::ActiveRecord do
|
|
53
53
|
|
54
54
|
end
|
55
55
|
|
56
|
+
context 'when the options are passed as a hash' do
|
57
|
+
before :each do
|
58
|
+
@klass = Song.disposable_copy do
|
59
|
+
assignable_values_for(:virtual_multi_genres, { :multiple => true, :allow_blank => true }) do
|
60
|
+
%w[pop rock]
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'should not raise an error' do
|
66
|
+
@klass.new(:virtual_multi_genres => ['rock']).should be_valid
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
56
70
|
context 'when validating virtual attributes with multiple: true' do
|
57
71
|
|
58
72
|
context 'with allow_blank: false' do
|
@@ -122,7 +136,7 @@ describe AssignableValues::ActiveRecord do
|
|
122
136
|
record = @klass.new(:genre => 'disallowed value')
|
123
137
|
record.valid?
|
124
138
|
errors = record.errors[:genre]
|
125
|
-
error = errors.
|
139
|
+
error = errors.respond_to?(:first) ? errors.first : errors # the return value sometimes was a string, sometimes an Array in Rails
|
126
140
|
error.should == I18n.t('errors.messages.inclusion')
|
127
141
|
error.should == 'is not included in the list'
|
128
142
|
end
|
@@ -274,7 +288,7 @@ describe AssignableValues::ActiveRecord do
|
|
274
288
|
record = @klass.new(:genre => 'disallowed value')
|
275
289
|
record.valid?
|
276
290
|
errors = record.errors[:genre]
|
277
|
-
error = errors.
|
291
|
+
error = errors.respond_to?(:first) ? errors.first : errors # the return value sometimes was a string, sometimes an Array in Rails
|
278
292
|
error.should == 'should be something different'
|
279
293
|
end
|
280
294
|
|
@@ -373,7 +387,7 @@ describe AssignableValues::ActiveRecord do
|
|
373
387
|
record = klass.new(:artist => disallowed_association)
|
374
388
|
record.valid?
|
375
389
|
errors = record.errors[:artist_id]
|
376
|
-
error = errors.
|
390
|
+
error = errors.respond_to?(:first) ? errors.first : errors # the return value sometimes was a string, sometimes an Array in Rails
|
377
391
|
error.should == I18n.t('errors.messages.inclusion')
|
378
392
|
end
|
379
393
|
|
@@ -828,6 +842,16 @@ describe AssignableValues::ActiveRecord do
|
|
828
842
|
klass.new.assignable_genres.should == []
|
829
843
|
end
|
830
844
|
|
845
|
+
it 'should not return saved value twice (BUGFIX)' do
|
846
|
+
klass = Song.disposable_copy do
|
847
|
+
assignable_values_for :multi_genres, :multiple => true do
|
848
|
+
%w[pop rock]
|
849
|
+
end
|
850
|
+
end
|
851
|
+
record = klass.create!(:multi_genres => ['pop'])
|
852
|
+
record.assignable_multi_genres.should eq ['pop', 'rock']
|
853
|
+
end
|
854
|
+
|
831
855
|
it 'should prepend a previously saved value to the top of the list, even if is no longer allowed' do
|
832
856
|
klass = Song.disposable_copy do
|
833
857
|
assignable_values_for :genre do
|
@@ -987,7 +1011,7 @@ describe AssignableValues::ActiveRecord do
|
|
987
1011
|
end
|
988
1012
|
years = klass.new.humanized_assignable_years
|
989
1013
|
years.collect(&:value).should == [1977, 1980, 1983]
|
990
|
-
years.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire
|
1014
|
+
years.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire struck back', 'The year the Jedi returned']
|
991
1015
|
end
|
992
1016
|
|
993
1017
|
it 'should properly look up humanizations for namespaced models' do
|
@@ -997,7 +1021,37 @@ describe AssignableValues::ActiveRecord do
|
|
997
1021
|
end
|
998
1022
|
end
|
999
1023
|
years = klass.new.humanized_assignable_years
|
1000
|
-
years.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire
|
1024
|
+
years.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire struck back', 'The year the Jedi returned']
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
context 'when inheriting from a model with defined assignable_values' do
|
1028
|
+
|
1029
|
+
let(:base_class) do
|
1030
|
+
Class.new(Song) do
|
1031
|
+
assignable_values_for :year do
|
1032
|
+
[1977, 1980, 1983]
|
1033
|
+
end
|
1034
|
+
end
|
1035
|
+
end
|
1036
|
+
|
1037
|
+
it 'allows to override humanization for inherited values' do
|
1038
|
+
Song::SeriousRepresentation = Class.new(base_class)
|
1039
|
+
|
1040
|
+
years = Song::SeriousRepresentation.new.humanized_assignable_years
|
1041
|
+
years.collect(&:humanized).should == ['year 1977', 'year 1980', 'year 1983']
|
1042
|
+
end
|
1043
|
+
|
1044
|
+
it 'looks up humanization in parent classes if the translation is not overridden' do
|
1045
|
+
Song::Extension = Class.new(base_class)
|
1046
|
+
Song::ExtendedExtension = Class.new(Song::Extension)
|
1047
|
+
|
1048
|
+
years_1 = Song::Extension.new.humanized_assignable_years
|
1049
|
+
years_1.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire struck back', 'The year the Jedi returned']
|
1050
|
+
|
1051
|
+
years_2 = Song::ExtendedExtension.new.humanized_assignable_years
|
1052
|
+
years_2.collect(&:humanized).should == ['The year a new hope was born', 'The year the Empire struck back', 'The year the Jedi returned']
|
1053
|
+
end
|
1054
|
+
|
1001
1055
|
end
|
1002
1056
|
|
1003
1057
|
context 'legacy methods for API compatibility' do
|
data/spec/support/i18n.yml
CHANGED
@@ -23,10 +23,15 @@ en:
|
|
23
23
|
rock: 'Rock music'
|
24
24
|
year:
|
25
25
|
'1977': 'The year a new hope was born'
|
26
|
-
'1980': 'The year the Empire
|
26
|
+
'1980': 'The year the Empire struck back'
|
27
27
|
'1983': 'The year the Jedi returned'
|
28
|
+
song/serious_representation:
|
29
|
+
year:
|
30
|
+
'1977': 'year 1977'
|
31
|
+
'1980': 'year 1980'
|
32
|
+
'1983': 'year 1983'
|
28
33
|
recording/vinyl:
|
29
34
|
year:
|
30
35
|
'1977': 'The year a new hope was born'
|
31
|
-
'1980': 'The year the Empire
|
36
|
+
'1980': 'The year the Empire struck back'
|
32
37
|
'1983': 'The year the Jedi returned'
|
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: 0.
|
4
|
+
version: 0.17.0
|
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: 2022-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -30,26 +30,22 @@ executables: []
|
|
30
30
|
extensions: []
|
31
31
|
extra_rdoc_files: []
|
32
32
|
files:
|
33
|
+
- ".github/workflows/test.yml"
|
33
34
|
- ".gitignore"
|
34
35
|
- ".rspec"
|
35
36
|
- ".ruby-version"
|
36
|
-
- ".travis.yml"
|
37
37
|
- CHANGELOG.md
|
38
38
|
- Gemfile
|
39
|
-
- Gemfile.2.3
|
40
|
-
- Gemfile.2.3.lock
|
41
|
-
- Gemfile.3.2
|
42
|
-
- Gemfile.3.2.lock
|
43
|
-
- Gemfile.4.2
|
44
|
-
- Gemfile.4.2.lock
|
45
39
|
- Gemfile.5.0
|
46
40
|
- Gemfile.5.0.lock
|
47
41
|
- Gemfile.5.1
|
48
42
|
- Gemfile.5.1.lock
|
49
43
|
- Gemfile.5.1.pg
|
50
44
|
- Gemfile.5.1.pg.lock
|
51
|
-
- Gemfile.6.
|
52
|
-
- Gemfile.6.
|
45
|
+
- Gemfile.6.1.pg
|
46
|
+
- Gemfile.6.1.pg.lock
|
47
|
+
- Gemfile.7.0.pg
|
48
|
+
- Gemfile.7.0.pg.lock
|
53
49
|
- Gemfile.lock
|
54
50
|
- LICENSE
|
55
51
|
- README.md
|
@@ -67,15 +63,18 @@ files:
|
|
67
63
|
- spec/assignable_values/active_record_spec.rb
|
68
64
|
- spec/assignable_values/humanized_value_spec.rb
|
69
65
|
- spec/spec_helper.rb
|
66
|
+
- spec/support/database.github.yml
|
70
67
|
- spec/support/database.rb
|
71
68
|
- spec/support/database.sample.yml
|
72
|
-
- spec/support/database.travis.yml
|
73
69
|
- spec/support/i18n.yml
|
74
70
|
- spec/support/models.rb
|
75
71
|
homepage: https://github.com/makandra/assignable_values
|
76
72
|
licenses:
|
77
73
|
- MIT
|
78
|
-
metadata:
|
74
|
+
metadata:
|
75
|
+
bug_tracker_uri: https://github.com/makandra/assignable_values/issues
|
76
|
+
changelog_uri: https://github.com/makandra/assignable_values/blob/master/CHANGELOG.md
|
77
|
+
rubygems_mfa_required: 'true'
|
79
78
|
post_install_message:
|
80
79
|
rdoc_options: []
|
81
80
|
require_paths:
|
@@ -91,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
90
|
- !ruby/object:Gem::Version
|
92
91
|
version: '0'
|
93
92
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
93
|
+
rubygems_version: 3.2.15
|
95
94
|
signing_key:
|
96
95
|
specification_version: 4
|
97
96
|
summary: Restrict the values assignable to ActiveRecord attributes or associations
|
@@ -99,8 +98,8 @@ test_files:
|
|
99
98
|
- spec/assignable_values/active_record_spec.rb
|
100
99
|
- spec/assignable_values/humanized_value_spec.rb
|
101
100
|
- spec/spec_helper.rb
|
101
|
+
- spec/support/database.github.yml
|
102
102
|
- spec/support/database.rb
|
103
103
|
- spec/support/database.sample.yml
|
104
|
-
- spec/support/database.travis.yml
|
105
104
|
- spec/support/i18n.yml
|
106
105
|
- spec/support/models.rb
|
data/.travis.yml
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
dist: trusty
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 1.8.7
|
7
|
-
- 2.1.8
|
8
|
-
- 2.3.8
|
9
|
-
- 2.4.2
|
10
|
-
- 2.5.3
|
11
|
-
|
12
|
-
gemfile:
|
13
|
-
- Gemfile.2.3
|
14
|
-
- Gemfile.3.2
|
15
|
-
- Gemfile.4.2
|
16
|
-
- Gemfile.5.0
|
17
|
-
- Gemfile.5.1
|
18
|
-
- Gemfile.5.1.pg
|
19
|
-
- Gemfile.6.0.pg
|
20
|
-
|
21
|
-
matrix:
|
22
|
-
exclude:
|
23
|
-
- gemfile: Gemfile.2.3
|
24
|
-
rvm: 2.1.8
|
25
|
-
- gemfile: Gemfile.2.3
|
26
|
-
rvm: 2.3.8
|
27
|
-
- gemfile: Gemfile.2.3
|
28
|
-
rvm: 2.4.2
|
29
|
-
- gemfile: Gemfile.2.3
|
30
|
-
rvm: 2.5.3
|
31
|
-
- gemfile: Gemfile.3.2
|
32
|
-
rvm: 2.3.8
|
33
|
-
- gemfile: Gemfile.3.2
|
34
|
-
rvm: 2.4.2
|
35
|
-
- gemfile: Gemfile.3.2
|
36
|
-
rvm: 2.5.3
|
37
|
-
- gemfile: Gemfile.4.2
|
38
|
-
rvm: 1.8.7
|
39
|
-
- gemfile: Gemfile.4.2
|
40
|
-
rvm: 2.4.2
|
41
|
-
- gemfile: Gemfile.4.2
|
42
|
-
rvm: 2.5.3
|
43
|
-
- gemfile: Gemfile.5.0
|
44
|
-
rvm: 1.8.7
|
45
|
-
- gemfile: Gemfile.5.0
|
46
|
-
rvm: 2.1.8
|
47
|
-
- gemfile: Gemfile.5.1
|
48
|
-
rvm: 1.8.7
|
49
|
-
- gemfile: Gemfile.5.1
|
50
|
-
rvm: 2.1.8
|
51
|
-
- gemfile: Gemfile.5.1.pg
|
52
|
-
rvm: 1.8.7
|
53
|
-
- gemfile: Gemfile.5.1.pg
|
54
|
-
rvm: 2.1.8
|
55
|
-
- gemfile: Gemfile.6.0.pg
|
56
|
-
rvm: 1.8.7
|
57
|
-
- gemfile: Gemfile.6.0.pg
|
58
|
-
rvm: 2.1.8
|
59
|
-
- gemfile: Gemfile.6.0.pg
|
60
|
-
rvm: 2.3.8
|
61
|
-
- gemfile: Gemfile.6.0.pg
|
62
|
-
rvm: 2.4.2
|
63
|
-
|
64
|
-
addons:
|
65
|
-
postgresql: "9.4"
|
66
|
-
|
67
|
-
sudo: false
|
68
|
-
|
69
|
-
cache: bundler
|
70
|
-
|
71
|
-
before_script:
|
72
|
-
- psql -c 'create database assignable_values_test;' -U postgres
|
73
|
-
- mysql -e 'create database IF NOT EXISTS assignable_values_test;'
|
74
|
-
|
75
|
-
install:
|
76
|
-
# Old Travis CI bundler explodes when lockfile version doesn't match recently bumped version
|
77
|
-
- gem install bundler --version='=1.17.3'
|
78
|
-
# This is the default Travis CI install step
|
79
|
-
- bundle install --jobs=3 --retry=3 --deployment --path=${BUNDLE_PATH:-vendor/bundle}
|
80
|
-
|
81
|
-
script: bundle exec rake current_rspec
|
data/Gemfile.2.3
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Runtime dependencies
|
4
|
-
gem 'activerecord', '~>2.3.0'
|
5
|
-
gem 'i18n', '<0.7' # 0.7 no longer builds for Ruby 1.8.7
|
6
|
-
gem 'mysql2', '= 0.2.24'
|
7
|
-
|
8
|
-
# Development dependencies
|
9
|
-
gem 'rake', '=10.0.4'
|
10
|
-
gem 'database_cleaner', '~> 1.0.0'
|
11
|
-
gem 'rspec', '~> 1.3.0'
|
12
|
-
gem 'rspec_candy'
|
13
|
-
gem 'gemika'
|
14
|
-
|
15
|
-
# Gem under test
|
16
|
-
gem 'assignable_values', :path => '.'
|
data/Gemfile.2.3.lock
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
assignable_values (0.16.4)
|
5
|
-
activerecord (>= 2.3)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
activerecord (2.3.17)
|
11
|
-
activesupport (= 2.3.17)
|
12
|
-
activesupport (2.3.17)
|
13
|
-
database_cleaner (1.0.1)
|
14
|
-
gemika (0.3.2)
|
15
|
-
i18n (0.6.11)
|
16
|
-
mysql2 (0.2.24)
|
17
|
-
rake (10.0.4)
|
18
|
-
rspec (1.3.2)
|
19
|
-
rspec_candy (0.2.8)
|
20
|
-
rspec
|
21
|
-
sneaky-save
|
22
|
-
sneaky-save (0.0.2)
|
23
|
-
activerecord (>= 2.3.2)
|
24
|
-
|
25
|
-
PLATFORMS
|
26
|
-
ruby
|
27
|
-
|
28
|
-
DEPENDENCIES
|
29
|
-
activerecord (~> 2.3.0)
|
30
|
-
assignable_values!
|
31
|
-
database_cleaner (~> 1.0.0)
|
32
|
-
gemika
|
33
|
-
i18n (< 0.7)
|
34
|
-
mysql2 (= 0.2.24)
|
35
|
-
rake (= 10.0.4)
|
36
|
-
rspec (~> 1.3.0)
|
37
|
-
rspec_candy
|
38
|
-
|
39
|
-
BUNDLED WITH
|
40
|
-
1.16.1
|
data/Gemfile.3.2
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
# Runtime dependencies
|
4
|
-
gem 'activerecord', '~>3.2.0'
|
5
|
-
gem 'i18n', '<0.7'
|
6
|
-
gem 'mysql2', '= 0.3.17'
|
7
|
-
|
8
|
-
# Development dependencies
|
9
|
-
gem 'rake'
|
10
|
-
gem 'database_cleaner', '~> 1.0.0'
|
11
|
-
gem 'rspec', '~> 3.4'
|
12
|
-
gem 'rspec_candy'
|
13
|
-
gem 'gemika'
|
14
|
-
|
15
|
-
# Gem under test
|
16
|
-
gem 'assignable_values', :path => '.'
|
data/Gemfile.3.2.lock
DELETED
@@ -1,65 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
assignable_values (0.16.4)
|
5
|
-
activerecord (>= 2.3)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
activemodel (3.2.22.5)
|
11
|
-
activesupport (= 3.2.22.5)
|
12
|
-
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.22.5)
|
14
|
-
activemodel (= 3.2.22.5)
|
15
|
-
activesupport (= 3.2.22.5)
|
16
|
-
arel (~> 3.0.2)
|
17
|
-
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.22.5)
|
19
|
-
i18n (~> 0.6, >= 0.6.4)
|
20
|
-
multi_json (~> 1.0)
|
21
|
-
arel (3.0.3)
|
22
|
-
builder (3.0.4)
|
23
|
-
database_cleaner (1.0.1)
|
24
|
-
diff-lcs (1.2.5)
|
25
|
-
gemika (0.3.2)
|
26
|
-
i18n (0.6.11)
|
27
|
-
multi_json (1.12.1)
|
28
|
-
mysql2 (0.3.17)
|
29
|
-
rake (10.0.3)
|
30
|
-
rspec (3.5.0)
|
31
|
-
rspec-core (~> 3.5.0)
|
32
|
-
rspec-expectations (~> 3.5.0)
|
33
|
-
rspec-mocks (~> 3.5.0)
|
34
|
-
rspec-core (3.5.4)
|
35
|
-
rspec-support (~> 3.5.0)
|
36
|
-
rspec-expectations (3.5.0)
|
37
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.5.0)
|
39
|
-
rspec-mocks (3.5.0)
|
40
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.5.0)
|
42
|
-
rspec-support (3.5.0)
|
43
|
-
rspec_candy (0.2.8)
|
44
|
-
rspec
|
45
|
-
sneaky-save
|
46
|
-
sneaky-save (0.0.4)
|
47
|
-
activerecord (>= 3.2.0)
|
48
|
-
tzinfo (0.3.52)
|
49
|
-
|
50
|
-
PLATFORMS
|
51
|
-
ruby
|
52
|
-
|
53
|
-
DEPENDENCIES
|
54
|
-
activerecord (~> 3.2.0)
|
55
|
-
assignable_values!
|
56
|
-
database_cleaner (~> 1.0.0)
|
57
|
-
gemika
|
58
|
-
i18n (< 0.7)
|
59
|
-
mysql2 (= 0.3.17)
|
60
|
-
rake
|
61
|
-
rspec (~> 3.4)
|
62
|
-
rspec_candy
|
63
|
-
|
64
|
-
BUNDLED WITH
|
65
|
-
1.16.1
|
data/Gemfile.4.2.lock
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
assignable_values (0.16.4)
|
5
|
-
activerecord (>= 2.3)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
activemodel (4.2.7.1)
|
11
|
-
activesupport (= 4.2.7.1)
|
12
|
-
builder (~> 3.1)
|
13
|
-
activerecord (4.2.7.1)
|
14
|
-
activemodel (= 4.2.7.1)
|
15
|
-
activesupport (= 4.2.7.1)
|
16
|
-
arel (~> 6.0)
|
17
|
-
activesupport (4.2.7.1)
|
18
|
-
i18n (~> 0.7)
|
19
|
-
json (~> 1.7, >= 1.7.7)
|
20
|
-
minitest (~> 5.1)
|
21
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
22
|
-
tzinfo (~> 1.1)
|
23
|
-
arel (6.0.3)
|
24
|
-
builder (3.2.2)
|
25
|
-
database_cleaner (1.5.3)
|
26
|
-
diff-lcs (1.2.5)
|
27
|
-
gemika (0.3.2)
|
28
|
-
i18n (0.7.0)
|
29
|
-
json (1.8.3)
|
30
|
-
minitest (5.9.1)
|
31
|
-
mysql2 (0.3.20)
|
32
|
-
rake (10.3.2)
|
33
|
-
rspec (3.5.0)
|
34
|
-
rspec-core (~> 3.5.0)
|
35
|
-
rspec-expectations (~> 3.5.0)
|
36
|
-
rspec-mocks (~> 3.5.0)
|
37
|
-
rspec-core (3.5.4)
|
38
|
-
rspec-support (~> 3.5.0)
|
39
|
-
rspec-expectations (3.5.0)
|
40
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.5.0)
|
42
|
-
rspec-mocks (3.5.0)
|
43
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
-
rspec-support (~> 3.5.0)
|
45
|
-
rspec-support (3.5.0)
|
46
|
-
rspec_candy (0.3.1)
|
47
|
-
rspec
|
48
|
-
sneaky-save
|
49
|
-
sneaky-save (0.0.5)
|
50
|
-
activerecord (>= 3.2.0)
|
51
|
-
thread_safe (0.3.5)
|
52
|
-
tzinfo (1.2.2)
|
53
|
-
thread_safe (~> 0.1)
|
54
|
-
|
55
|
-
PLATFORMS
|
56
|
-
ruby
|
57
|
-
|
58
|
-
DEPENDENCIES
|
59
|
-
activerecord (~> 4.2.0)
|
60
|
-
assignable_values!
|
61
|
-
database_cleaner
|
62
|
-
gemika
|
63
|
-
i18n (~> 0.7.0)
|
64
|
-
mysql2 (~> 0.3.17)
|
65
|
-
rake
|
66
|
-
rspec (~> 3.4)
|
67
|
-
rspec_candy
|
68
|
-
|
69
|
-
BUNDLED WITH
|
70
|
-
1.16.4
|