active_type 1.5.0 → 1.6.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 +21 -12
- data/CHANGELOG.md +4 -0
- data/Gemfile.3.2.mysql2.lock +1 -1
- data/Gemfile.3.2.sqlite3.lock +1 -1
- data/Gemfile.4.2.mysql2.lock +1 -1
- data/Gemfile.4.2.pg.lock +1 -1
- data/Gemfile.4.2.sqlite3.lock +1 -1
- data/Gemfile.5.2.mysql2.lock +25 -25
- data/Gemfile.5.2.pg.lock +26 -26
- data/Gemfile.5.2.sqlite3.lock +26 -26
- data/{Gemfile.6.0.pg → Gemfile.6.0.sqlite3} +1 -1
- data/Gemfile.6.0.sqlite3.lock +59 -0
- data/Gemfile.6.1.pg +9 -0
- data/Gemfile.6.1.pg.lock +58 -0
- data/Gemfile.6.1.sqlite3 +9 -0
- data/Gemfile.6.1.sqlite3.lock +58 -0
- data/README.md +4 -1
- data/Rakefile +1 -1
- data/lib/active_type/nested_attributes/association.rb +19 -7
- data/lib/active_type/version.rb +1 -1
- data/lib/active_type/virtual_attributes.rb +8 -2
- metadata +8 -5
- data/.travis.yml +0 -72
- data/Gemfile.6.0.pg.lock +0 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd106690815f11c7582797456d2915ae313899725bfab18aa1ada385c66367cc
|
4
|
+
data.tar.gz: 1aec1dec85d519dfa8d75ae3985e1e182963725369c783eb8b2254f6406bba97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 611573072b7632eec3d78e7a80263ff4844100b2c401879fbbfe326d8d68cf2f3780fdaa7c260f8917aaadbe343f263472c12a42a797d6dbead714540df2a5bb
|
7
|
+
data.tar.gz: 6a0e49c446ada6f2a63cad98ab59ab552015e3fe3c573fe4075ba28f0ddb02b084cb5b604f005da6f99bad2221e8dfdc9c3d6f90963bd6142a62525b0c5af39c
|
data/.github/workflows/test.yml
CHANGED
@@ -15,16 +15,20 @@ jobs:
|
|
15
15
|
matrix:
|
16
16
|
ruby:
|
17
17
|
- "2.3.8"
|
18
|
-
- "2.4.6"
|
19
18
|
- "2.5.5"
|
20
19
|
- "2.6.3"
|
20
|
+
- "2.7.2"
|
21
21
|
gemfile:
|
22
22
|
- Gemfile.3.2.sqlite3
|
23
23
|
- Gemfile.4.2.sqlite3
|
24
24
|
- Gemfile.5.2.sqlite3
|
25
|
+
- Gemfile.6.0.sqlite3
|
26
|
+
- Gemfile.6.1.sqlite3
|
25
27
|
exclude:
|
26
|
-
- ruby: "2.
|
27
|
-
gemfile: Gemfile.
|
28
|
+
- ruby: "2.3.8"
|
29
|
+
gemfile: Gemfile.6.0.sqlite3
|
30
|
+
- ruby: "2.3.8"
|
31
|
+
gemfile: Gemfile.6.1.sqlite3
|
28
32
|
- ruby: "2.5.5"
|
29
33
|
gemfile: Gemfile.3.2.sqlite3
|
30
34
|
- ruby: "2.5.5"
|
@@ -33,6 +37,10 @@ jobs:
|
|
33
37
|
gemfile: Gemfile.3.2.sqlite3
|
34
38
|
- ruby: "2.6.3"
|
35
39
|
gemfile: Gemfile.4.2.sqlite3
|
40
|
+
- ruby: "2.7.2"
|
41
|
+
gemfile: Gemfile.3.2.sqlite3
|
42
|
+
- ruby: "2.7.2"
|
43
|
+
gemfile: Gemfile.4.2.sqlite3
|
36
44
|
|
37
45
|
env:
|
38
46
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
@@ -72,20 +80,14 @@ jobs:
|
|
72
80
|
matrix:
|
73
81
|
ruby:
|
74
82
|
- "2.3.8"
|
75
|
-
- "2.4.6"
|
76
83
|
- "2.5.5"
|
77
84
|
- "2.6.3"
|
85
|
+
- "2.7.2"
|
78
86
|
gemfile:
|
79
87
|
- Gemfile.3.2.mysql2
|
80
88
|
- Gemfile.4.2.mysql2
|
81
89
|
- Gemfile.5.2.mysql2
|
82
90
|
exclude:
|
83
|
-
- ruby: "2.4.6"
|
84
|
-
gemfile: Gemfile.3.2.mysql2
|
85
|
-
- ruby: "2.4.6"
|
86
|
-
gemfile: Gemfile.4.2.mysql2
|
87
|
-
- ruby: "2.4.6"
|
88
|
-
gemfile: Gemfile.5.2.mysql2
|
89
91
|
- ruby: "2.5.5"
|
90
92
|
gemfile: Gemfile.3.2.mysql2
|
91
93
|
- ruby: "2.5.5"
|
@@ -96,6 +98,10 @@ jobs:
|
|
96
98
|
gemfile: Gemfile.3.2.mysql2
|
97
99
|
- ruby: "2.6.3"
|
98
100
|
gemfile: Gemfile.4.2.mysql2
|
101
|
+
- ruby: "2.7.2"
|
102
|
+
gemfile: Gemfile.3.2.mysql2
|
103
|
+
- ruby: "2.7.2"
|
104
|
+
gemfile: Gemfile.4.2.mysql2
|
99
105
|
|
100
106
|
env:
|
101
107
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
@@ -144,19 +150,22 @@ jobs:
|
|
144
150
|
- "2.3.8"
|
145
151
|
- "2.5.5"
|
146
152
|
- "2.6.3"
|
153
|
+
- "2.7.2"
|
147
154
|
gemfile:
|
148
155
|
- Gemfile.4.2.pg
|
149
156
|
- Gemfile.5.2.pg
|
150
|
-
- Gemfile.6.
|
157
|
+
- Gemfile.6.1.pg
|
151
158
|
exclude:
|
152
159
|
- ruby: "2.3.8"
|
153
|
-
gemfile: Gemfile.6.
|
160
|
+
gemfile: Gemfile.6.1.pg
|
154
161
|
- ruby: "2.5.5"
|
155
162
|
gemfile: Gemfile.4.2.pg
|
156
163
|
- ruby: "2.5.5"
|
157
164
|
gemfile: Gemfile.5.2.pg
|
158
165
|
- ruby: "2.6.3"
|
159
166
|
gemfile: Gemfile.4.2.pg
|
167
|
+
- ruby: "2.7.2"
|
168
|
+
gemfile: Gemfile.4.2.pg
|
160
169
|
|
161
170
|
env:
|
162
171
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
|
5
5
|
## Unreleased changes
|
6
6
|
|
7
|
+
## 1.6.0 (2021-03-04)
|
8
|
+
|
9
|
+
* Fixed: Numerous issues with Rails 6.1. Thanks to @vr4b4c for some of the changes.
|
10
|
+
|
7
11
|
## 1.5.0 (2020-11-06)
|
8
12
|
|
9
13
|
* Added: When serializing/deserializing `ActiveType::Record` or `ActiveType::Object` with YAML, virtual attributes are restored.
|
data/Gemfile.3.2.mysql2.lock
CHANGED
data/Gemfile.3.2.sqlite3.lock
CHANGED
data/Gemfile.4.2.mysql2.lock
CHANGED
data/Gemfile.4.2.pg.lock
CHANGED
data/Gemfile.4.2.sqlite3.lock
CHANGED
data/Gemfile.5.2.mysql2.lock
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_type (1.
|
4
|
+
active_type (1.6.0)
|
5
5
|
activerecord (>= 3.2)
|
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
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.1.
|
23
|
-
diff-lcs (1.
|
24
|
-
gemika (0.
|
25
|
-
i18n (1.5
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
gemika (0.5.0)
|
25
|
+
i18n (1.8.5)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
minitest (5.
|
27
|
+
minitest (5.14.2)
|
28
28
|
mysql2 (0.5.3)
|
29
|
-
rake (
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.
|
32
|
-
rspec-expectations (~> 3.
|
33
|
-
rspec-mocks (~> 3.
|
34
|
-
rspec-core (3.
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-expectations (3.
|
29
|
+
rake (13.0.1)
|
30
|
+
rspec (3.10.0)
|
31
|
+
rspec-core (~> 3.10.0)
|
32
|
+
rspec-expectations (~> 3.10.0)
|
33
|
+
rspec-mocks (~> 3.10.0)
|
34
|
+
rspec-core (3.10.0)
|
35
|
+
rspec-support (~> 3.10.0)
|
36
|
+
rspec-expectations (3.10.0)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
38
|
+
rspec-support (~> 3.10.0)
|
39
|
+
rspec-mocks (3.10.0)
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
41
|
+
rspec-support (~> 3.10.0)
|
42
|
+
rspec-support (3.10.0)
|
43
43
|
thread_safe (0.3.6)
|
44
|
-
tzinfo (1.2.
|
44
|
+
tzinfo (1.2.8)
|
45
45
|
thread_safe (~> 0.1)
|
46
46
|
|
47
47
|
PLATFORMS
|
data/Gemfile.5.2.pg.lock
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_type (1.
|
4
|
+
active_type (1.6.0)
|
5
5
|
activerecord (>= 3.2)
|
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
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.1.
|
23
|
-
diff-lcs (1.
|
24
|
-
gemika (0.
|
25
|
-
i18n (1.5
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
gemika (0.5.0)
|
25
|
+
i18n (1.8.5)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
minitest (5.
|
28
|
-
pg (
|
29
|
-
rake (
|
30
|
-
rspec (3.
|
31
|
-
rspec-core (~> 3.
|
32
|
-
rspec-expectations (~> 3.
|
33
|
-
rspec-mocks (~> 3.
|
34
|
-
rspec-core (3.
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-expectations (3.
|
27
|
+
minitest (5.14.2)
|
28
|
+
pg (1.2.3)
|
29
|
+
rake (13.0.1)
|
30
|
+
rspec (3.10.0)
|
31
|
+
rspec-core (~> 3.10.0)
|
32
|
+
rspec-expectations (~> 3.10.0)
|
33
|
+
rspec-mocks (~> 3.10.0)
|
34
|
+
rspec-core (3.10.0)
|
35
|
+
rspec-support (~> 3.10.0)
|
36
|
+
rspec-expectations (3.10.0)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-mocks (3.
|
38
|
+
rspec-support (~> 3.10.0)
|
39
|
+
rspec-mocks (3.10.0)
|
40
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
-
rspec-support (~> 3.
|
42
|
-
rspec-support (3.
|
41
|
+
rspec-support (~> 3.10.0)
|
42
|
+
rspec-support (3.10.0)
|
43
43
|
thread_safe (0.3.6)
|
44
|
-
tzinfo (1.2.
|
44
|
+
tzinfo (1.2.8)
|
45
45
|
thread_safe (~> 0.1)
|
46
46
|
|
47
47
|
PLATFORMS
|
data/Gemfile.5.2.sqlite3.lock
CHANGED
@@ -1,47 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active_type (1.
|
4
|
+
active_type (1.6.0)
|
5
5
|
activerecord (>= 3.2)
|
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
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.1.
|
23
|
-
diff-lcs (1.
|
24
|
-
gemika (0.
|
25
|
-
i18n (1.5
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
diff-lcs (1.4.4)
|
24
|
+
gemika (0.5.0)
|
25
|
+
i18n (1.8.5)
|
26
26
|
concurrent-ruby (~> 1.0)
|
27
|
-
minitest (5.
|
28
|
-
rake (
|
29
|
-
rspec (3.
|
30
|
-
rspec-core (~> 3.
|
31
|
-
rspec-expectations (~> 3.
|
32
|
-
rspec-mocks (~> 3.
|
33
|
-
rspec-core (3.
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-expectations (3.
|
27
|
+
minitest (5.14.2)
|
28
|
+
rake (13.0.1)
|
29
|
+
rspec (3.10.0)
|
30
|
+
rspec-core (~> 3.10.0)
|
31
|
+
rspec-expectations (~> 3.10.0)
|
32
|
+
rspec-mocks (~> 3.10.0)
|
33
|
+
rspec-core (3.10.0)
|
34
|
+
rspec-support (~> 3.10.0)
|
35
|
+
rspec-expectations (3.10.0)
|
36
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-mocks (3.10.0)
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
42
|
-
sqlite3 (1.
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-support (3.10.0)
|
42
|
+
sqlite3 (1.4.2)
|
43
43
|
thread_safe (0.3.6)
|
44
|
-
tzinfo (1.2.
|
44
|
+
tzinfo (1.2.8)
|
45
45
|
thread_safe (~> 0.1)
|
46
46
|
|
47
47
|
PLATFORMS
|
@@ -0,0 +1,59 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
active_type (1.6.0)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (6.0.3.4)
|
11
|
+
activesupport (= 6.0.3.4)
|
12
|
+
activerecord (6.0.3.4)
|
13
|
+
activemodel (= 6.0.3.4)
|
14
|
+
activesupport (= 6.0.3.4)
|
15
|
+
activesupport (6.0.3.4)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 0.7, < 2)
|
18
|
+
minitest (~> 5.1)
|
19
|
+
tzinfo (~> 1.1)
|
20
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
21
|
+
concurrent-ruby (1.1.7)
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
gemika (0.5.0)
|
24
|
+
i18n (1.8.5)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
minitest (5.14.2)
|
27
|
+
rake (13.0.1)
|
28
|
+
rspec (3.10.0)
|
29
|
+
rspec-core (~> 3.10.0)
|
30
|
+
rspec-expectations (~> 3.10.0)
|
31
|
+
rspec-mocks (~> 3.10.0)
|
32
|
+
rspec-core (3.10.0)
|
33
|
+
rspec-support (~> 3.10.0)
|
34
|
+
rspec-expectations (3.10.0)
|
35
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
+
rspec-support (~> 3.10.0)
|
37
|
+
rspec-mocks (3.10.0)
|
38
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-support (3.10.0)
|
41
|
+
sqlite3 (1.4.2)
|
42
|
+
thread_safe (0.3.6)
|
43
|
+
tzinfo (1.2.8)
|
44
|
+
thread_safe (~> 0.1)
|
45
|
+
zeitwerk (2.4.1)
|
46
|
+
|
47
|
+
PLATFORMS
|
48
|
+
ruby
|
49
|
+
|
50
|
+
DEPENDENCIES
|
51
|
+
active_type!
|
52
|
+
activerecord (~> 6.0.0)
|
53
|
+
gemika
|
54
|
+
rake
|
55
|
+
rspec (~> 3.4)
|
56
|
+
sqlite3
|
57
|
+
|
58
|
+
BUNDLED WITH
|
59
|
+
2.1.4
|
data/Gemfile.6.1.pg
ADDED
data/Gemfile.6.1.pg.lock
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
active_type (1.6.0)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (6.1.3)
|
11
|
+
activesupport (= 6.1.3)
|
12
|
+
activerecord (6.1.3)
|
13
|
+
activemodel (= 6.1.3)
|
14
|
+
activesupport (= 6.1.3)
|
15
|
+
activesupport (6.1.3)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
|
+
concurrent-ruby (1.1.8)
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
gemika (0.5.0)
|
24
|
+
i18n (1.8.9)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
minitest (5.14.4)
|
27
|
+
pg (1.2.3)
|
28
|
+
rake (13.0.3)
|
29
|
+
rspec (3.10.0)
|
30
|
+
rspec-core (~> 3.10.0)
|
31
|
+
rspec-expectations (~> 3.10.0)
|
32
|
+
rspec-mocks (~> 3.10.0)
|
33
|
+
rspec-core (3.10.1)
|
34
|
+
rspec-support (~> 3.10.0)
|
35
|
+
rspec-expectations (3.10.1)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-mocks (3.10.2)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-support (3.10.2)
|
42
|
+
tzinfo (2.0.4)
|
43
|
+
concurrent-ruby (~> 1.0)
|
44
|
+
zeitwerk (2.4.2)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
x86_64-linux
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
active_type!
|
51
|
+
activerecord (~> 6.1.0)
|
52
|
+
gemika
|
53
|
+
pg
|
54
|
+
rake
|
55
|
+
rspec (~> 3.4)
|
56
|
+
|
57
|
+
BUNDLED WITH
|
58
|
+
2.2.6
|
data/Gemfile.6.1.sqlite3
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
active_type (1.6.0)
|
5
|
+
activerecord (>= 3.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
activemodel (6.1.3)
|
11
|
+
activesupport (= 6.1.3)
|
12
|
+
activerecord (6.1.3)
|
13
|
+
activemodel (= 6.1.3)
|
14
|
+
activesupport (= 6.1.3)
|
15
|
+
activesupport (6.1.3)
|
16
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
+
i18n (>= 1.6, < 2)
|
18
|
+
minitest (>= 5.1)
|
19
|
+
tzinfo (~> 2.0)
|
20
|
+
zeitwerk (~> 2.3)
|
21
|
+
concurrent-ruby (1.1.8)
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
gemika (0.5.0)
|
24
|
+
i18n (1.8.9)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
minitest (5.14.4)
|
27
|
+
rake (13.0.3)
|
28
|
+
rspec (3.10.0)
|
29
|
+
rspec-core (~> 3.10.0)
|
30
|
+
rspec-expectations (~> 3.10.0)
|
31
|
+
rspec-mocks (~> 3.10.0)
|
32
|
+
rspec-core (3.10.1)
|
33
|
+
rspec-support (~> 3.10.0)
|
34
|
+
rspec-expectations (3.10.1)
|
35
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
+
rspec-support (~> 3.10.0)
|
37
|
+
rspec-mocks (3.10.2)
|
38
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
39
|
+
rspec-support (~> 3.10.0)
|
40
|
+
rspec-support (3.10.2)
|
41
|
+
sqlite3 (1.4.2)
|
42
|
+
tzinfo (2.0.4)
|
43
|
+
concurrent-ruby (~> 1.0)
|
44
|
+
zeitwerk (2.4.2)
|
45
|
+
|
46
|
+
PLATFORMS
|
47
|
+
x86_64-linux
|
48
|
+
|
49
|
+
DEPENDENCIES
|
50
|
+
active_type!
|
51
|
+
activerecord (~> 6.1.0)
|
52
|
+
gemika
|
53
|
+
rake
|
54
|
+
rspec (~> 3.4)
|
55
|
+
sqlite3
|
56
|
+
|
57
|
+
BUNDLED WITH
|
58
|
+
2.2.6
|
data/README.md
CHANGED
@@ -51,7 +51,7 @@ end
|
|
51
51
|
```
|
52
52
|
|
53
53
|
|
54
|
-
### A note on Rails 5
|
54
|
+
### A note on Rails 5+
|
55
55
|
|
56
56
|
Rails 5 comes with its own implementation of `.attribute`. This implementation is functionally very
|
57
57
|
similar, but not identical to ActiveType's.
|
@@ -114,6 +114,9 @@ This means your object has all usual `ActiveRecord::Base` methods. Some of those
|
|
114
114
|
- "saving" (returning `true` or `false`, without actually persisting)
|
115
115
|
- belongs_to (after saying `attribute :child_id, :integer`)
|
116
116
|
|
117
|
+
#### Note on transactions
|
118
|
+
|
119
|
+
Since `ActiveType::Object` is not backed by a database, it does not open a real transaction when saving, so you should not rely on database changes that might have happend in a `#save` callback to be rolled back when `#save` fails. If you need this, make sure to wrap those changes in an explicit transaction yourself.
|
117
120
|
|
118
121
|
### ActiveType::Record
|
119
122
|
|
data/Rakefile
CHANGED
@@ -27,7 +27,7 @@ namespace :matrix do
|
|
27
27
|
|
28
28
|
desc "Run specs for all Ruby #{RUBY_VERSION} gemfiles"
|
29
29
|
task :spec, :files do |t, options|
|
30
|
-
Gemika::Matrix.
|
30
|
+
Gemika::Matrix.from_ci_config.each do |row|
|
31
31
|
options = options.to_hash.merge(
|
32
32
|
:gemfile => row.gemfile,
|
33
33
|
:fatal => false,
|
@@ -42,13 +42,7 @@ module ActiveType
|
|
42
42
|
|
43
43
|
def validate(parent)
|
44
44
|
changed_children(parent).each_with_index do |child, index|
|
45
|
-
unless child.valid?
|
46
|
-
child.errors.each do |attribute, message|
|
47
|
-
attribute = @index_errors ? "#{@target_name}[#{index}].#{attribute}" : "#{@target_name}.#{attribute}"
|
48
|
-
parent.errors[attribute] << message
|
49
|
-
parent.errors[attribute].uniq!
|
50
|
-
end
|
51
|
-
end
|
45
|
+
add_errors_to_parent(parent, child, index) unless child.valid?
|
52
46
|
end
|
53
47
|
end
|
54
48
|
|
@@ -131,6 +125,24 @@ module ActiveType
|
|
131
125
|
[:build_scope, :find_scope, :scope, :allow_destroy, :reject_if]
|
132
126
|
end
|
133
127
|
|
128
|
+
def add_errors_to_parent(parent, child, index)
|
129
|
+
if ActiveRecord::VERSION::MAJOR >= 6 && ActiveRecord::VERSION::MINOR >= 1
|
130
|
+
child.errors.each do |error|
|
131
|
+
attribute = translate_error_attribute(error.attribute, index)
|
132
|
+
parent.errors.add(attribute, error.message)
|
133
|
+
end
|
134
|
+
else
|
135
|
+
child.errors.each do |attribute, message|
|
136
|
+
attribute = translate_error_attribute(attribute, index)
|
137
|
+
parent.errors.add(attribute, message)
|
138
|
+
parent.errors[attribute].uniq!
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
def translate_error_attribute(attribute, index)
|
144
|
+
@index_errors ? "#{@target_name}[#{index}].#{attribute}" : "#{@target_name}.#{attribute}"
|
145
|
+
end
|
134
146
|
end
|
135
147
|
|
136
148
|
end
|
data/lib/active_type/version.rb
CHANGED
@@ -185,7 +185,10 @@ module ActiveType
|
|
185
185
|
def _read_attribute(name)
|
186
186
|
read_existing_virtual_attribute(name) { super }
|
187
187
|
end
|
188
|
-
|
188
|
+
end
|
189
|
+
|
190
|
+
if ActiveRecord::VERSION::STRING < '4.2.0' || ActiveRecord::VERSION::STRING >= '6.1.0'
|
191
|
+
# in 6.1, read_attribute does not call _read_attribute
|
189
192
|
def read_attribute(name)
|
190
193
|
read_existing_virtual_attribute(name) { super }
|
191
194
|
end
|
@@ -199,7 +202,10 @@ module ActiveType
|
|
199
202
|
def _write_attribute(name, value)
|
200
203
|
write_existing_virtual_attribute(name, value) { super }
|
201
204
|
end
|
202
|
-
|
205
|
+
end
|
206
|
+
|
207
|
+
if ActiveRecord::VERSION::STRING < '5.2.0' || ActiveRecord::VERSION::STRING >= '6.1.0'
|
208
|
+
# in 6.1, write_attribute does not call _write_attribute
|
203
209
|
def write_attribute(name, value)
|
204
210
|
write_existing_virtual_attribute(name, value) { super }
|
205
211
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-03-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -63,7 +63,6 @@ files:
|
|
63
63
|
- ".gitignore"
|
64
64
|
- ".rspec"
|
65
65
|
- ".ruby-version"
|
66
|
-
- ".travis.yml"
|
67
66
|
- CHANGELOG.md
|
68
67
|
- Gemfile
|
69
68
|
- Gemfile.3.2.mysql2
|
@@ -82,8 +81,12 @@ files:
|
|
82
81
|
- Gemfile.5.2.pg.lock
|
83
82
|
- Gemfile.5.2.sqlite3
|
84
83
|
- Gemfile.5.2.sqlite3.lock
|
85
|
-
- Gemfile.6.0.
|
86
|
-
- Gemfile.6.0.
|
84
|
+
- Gemfile.6.0.sqlite3
|
85
|
+
- Gemfile.6.0.sqlite3.lock
|
86
|
+
- Gemfile.6.1.pg
|
87
|
+
- Gemfile.6.1.pg.lock
|
88
|
+
- Gemfile.6.1.sqlite3
|
89
|
+
- Gemfile.6.1.sqlite3.lock
|
87
90
|
- Gemfile.lock
|
88
91
|
- LICENSE
|
89
92
|
- README.md
|
data/.travis.yml
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: trusty
|
3
|
-
services:
|
4
|
-
- postgresql
|
5
|
-
rvm:
|
6
|
-
- "2.3.8"
|
7
|
-
- "2.4.6"
|
8
|
-
- "2.5.5"
|
9
|
-
- "2.6.3"
|
10
|
-
gemfile:
|
11
|
-
- Gemfile.3.2.mysql2
|
12
|
-
- Gemfile.3.2.sqlite3
|
13
|
-
- Gemfile.4.2.mysql2
|
14
|
-
- Gemfile.4.2.pg
|
15
|
-
- Gemfile.4.2.sqlite3
|
16
|
-
- Gemfile.5.2.mysql2
|
17
|
-
- Gemfile.5.2.sqlite3
|
18
|
-
- Gemfile.5.2.pg
|
19
|
-
- Gemfile.6.0.pg
|
20
|
-
before_script:
|
21
|
-
- psql -c 'create database active_type_test;' -U postgres
|
22
|
-
- mysql -e 'create database IF NOT EXISTS active_type_test;'
|
23
|
-
script: bundle exec rake spec
|
24
|
-
sudo: false
|
25
|
-
cache: bundler
|
26
|
-
matrix:
|
27
|
-
exclude:
|
28
|
-
- rvm: "2.3.8"
|
29
|
-
gemfile: Gemfile.6.0.pg
|
30
|
-
- rvm: "2.4.6"
|
31
|
-
gemfile: Gemfile.3.2.mysql2
|
32
|
-
- rvm: "2.4.6"
|
33
|
-
gemfile: Gemfile.3.2.sqlite3
|
34
|
-
- rvm: "2.4.6"
|
35
|
-
gemfile: Gemfile.4.2.mysql2
|
36
|
-
- rvm: "2.4.6"
|
37
|
-
gemfile: Gemfile.4.2.pg
|
38
|
-
- rvm: "2.4.6"
|
39
|
-
gemfile: Gemfile.5.2.mysql2
|
40
|
-
- rvm: "2.4.6"
|
41
|
-
gemfile: Gemfile.5.2.pg
|
42
|
-
- rvm: "2.4.6"
|
43
|
-
gemfile: Gemfile.6.0.pg
|
44
|
-
- rvm: "2.5.5"
|
45
|
-
gemfile: Gemfile.3.2.mysql2
|
46
|
-
- rvm: "2.5.5"
|
47
|
-
gemfile: Gemfile.3.2.sqlite3
|
48
|
-
- rvm: "2.5.5"
|
49
|
-
gemfile: Gemfile.4.2.mysql2
|
50
|
-
- rvm: "2.5.5"
|
51
|
-
gemfile: Gemfile.4.2.pg
|
52
|
-
- rvm: "2.5.5"
|
53
|
-
gemfile: Gemfile.4.2.sqlite3
|
54
|
-
- rvm: "2.5.5"
|
55
|
-
gemfile: Gemfile.5.2.mysql2
|
56
|
-
- rvm: "2.5.5"
|
57
|
-
gemfile: Gemfile.5.2.pg
|
58
|
-
- rvm: "2.6.3"
|
59
|
-
gemfile: Gemfile.3.2.mysql2
|
60
|
-
- rvm: "2.6.3"
|
61
|
-
gemfile: Gemfile.3.2.sqlite3
|
62
|
-
- rvm: "2.6.3"
|
63
|
-
gemfile: Gemfile.4.2.mysql2
|
64
|
-
- rvm: "2.6.3"
|
65
|
-
gemfile: Gemfile.4.2.pg
|
66
|
-
- rvm: "2.6.3"
|
67
|
-
gemfile: Gemfile.4.2.sqlite3
|
68
|
-
install:
|
69
|
-
- gem install bundler:2.0.2
|
70
|
-
- bundle install --no-deployment --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}
|
71
|
-
addons:
|
72
|
-
postgresql: 9.3
|
data/Gemfile.6.0.pg.lock
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
active_type (1.5.0)
|
5
|
-
activerecord (>= 3.2)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
activemodel (6.0.0)
|
11
|
-
activesupport (= 6.0.0)
|
12
|
-
activerecord (6.0.0)
|
13
|
-
activemodel (= 6.0.0)
|
14
|
-
activesupport (= 6.0.0)
|
15
|
-
activesupport (6.0.0)
|
16
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
|
-
i18n (>= 0.7, < 2)
|
18
|
-
minitest (~> 5.1)
|
19
|
-
tzinfo (~> 1.1)
|
20
|
-
zeitwerk (~> 2.1, >= 2.1.8)
|
21
|
-
concurrent-ruby (1.1.5)
|
22
|
-
diff-lcs (1.3)
|
23
|
-
gemika (0.4.1)
|
24
|
-
i18n (1.6.0)
|
25
|
-
concurrent-ruby (~> 1.0)
|
26
|
-
minitest (5.11.3)
|
27
|
-
pg (1.1.4)
|
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
|
-
thread_safe (0.3.6)
|
43
|
-
tzinfo (1.2.5)
|
44
|
-
thread_safe (~> 0.1)
|
45
|
-
zeitwerk (2.1.9)
|
46
|
-
|
47
|
-
PLATFORMS
|
48
|
-
ruby
|
49
|
-
|
50
|
-
DEPENDENCIES
|
51
|
-
active_type!
|
52
|
-
activerecord (~> 6.0.0)
|
53
|
-
gemika
|
54
|
-
pg
|
55
|
-
rake
|
56
|
-
rspec (~> 3.4)
|
57
|
-
|
58
|
-
BUNDLED WITH
|
59
|
-
2.1.4
|