active_type 2.3.2 → 2.3.3
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 +24 -29
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/Gemfile.5.2.mysql2.lock +1 -1
- data/Gemfile.5.2.pg.lock +1 -1
- data/Gemfile.5.2.sqlite3.lock +1 -1
- data/Gemfile.6.0.sqlite3.lock +1 -1
- data/Gemfile.6.1.pg.lock +1 -1
- data/Gemfile.6.1.sqlite3.lock +1 -1
- data/Gemfile.7.0.pg.lock +23 -23
- data/Gemfile.7.0.sqlite3.lock +27 -25
- data/Gemfile.lock +1 -1
- data/active_type.gemspec +6 -1
- data/lib/active_type/version.rb +1 -1
- data/lib/active_type/virtual_attributes.rb +8 -4
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cdcf7c3fd638833572dc67e729b154148f26c7e7dfbe107b9752e1e4aec08c0a
|
|
4
|
+
data.tar.gz: e7909485f8b1147a5d94079e5933bc5ee7f75f0eab32a68b6be9abd0be2d75b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93d20dd89b89f2764104074d36624feb091204f3e42f05100e715a1f36374dfcb13cc5f1c023be7fe75eecfdc2875cfb91c7ceeacfcc473ef424ebe7423060ba
|
|
7
|
+
data.tar.gz: 721e41bb1299dbd7ed944c33dae47e10fac3f6e167cb5b31f67faa32a017a6f3e8bbd2b4316d9ed32ea0eed2ba8e995b334df3e7640eb8ec69f3c46726ae36c7
|
data/.github/workflows/test.yml
CHANGED
|
@@ -16,29 +16,28 @@ jobs:
|
|
|
16
16
|
include:
|
|
17
17
|
- ruby: "2.5.5"
|
|
18
18
|
gemfile: Gemfile.5.2.sqlite3
|
|
19
|
-
- ruby: "2.7.
|
|
19
|
+
- ruby: "2.7.7"
|
|
20
20
|
gemfile: Gemfile.5.2.sqlite3
|
|
21
|
-
- ruby: "3.0.
|
|
21
|
+
- ruby: "3.0.5"
|
|
22
22
|
gemfile: Gemfile.6.0.sqlite3
|
|
23
|
-
- ruby: "3.0.
|
|
23
|
+
- ruby: "3.0.5"
|
|
24
24
|
gemfile: Gemfile.6.1.sqlite3
|
|
25
|
-
- ruby: "3.0.
|
|
25
|
+
- ruby: "3.0.5"
|
|
26
26
|
gemfile: Gemfile.7.0.sqlite3
|
|
27
|
-
- ruby: "3.1.
|
|
27
|
+
- ruby: "3.1.3"
|
|
28
|
+
gemfile: Gemfile.7.0.sqlite3
|
|
29
|
+
- ruby: "3.2.0"
|
|
28
30
|
gemfile: Gemfile.7.0.sqlite3
|
|
29
31
|
env:
|
|
30
32
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
31
33
|
|
|
32
34
|
steps:
|
|
33
|
-
- uses: actions/checkout@
|
|
35
|
+
- uses: actions/checkout@v3
|
|
34
36
|
- name: Install ruby
|
|
35
37
|
uses: ruby/setup-ruby@v1
|
|
36
38
|
with:
|
|
37
39
|
ruby-version: ${{ matrix.ruby }}
|
|
38
|
-
|
|
39
|
-
run: |
|
|
40
|
-
gem install bundler:2.2.27
|
|
41
|
-
bundle install --no-deployment
|
|
40
|
+
bundler-cache: true
|
|
42
41
|
- name: Run tests
|
|
43
42
|
run: bundle exec rake spec
|
|
44
43
|
|
|
@@ -62,22 +61,18 @@ jobs:
|
|
|
62
61
|
fail-fast: false
|
|
63
62
|
matrix:
|
|
64
63
|
include:
|
|
65
|
-
- ruby: "2.7.
|
|
64
|
+
- ruby: "2.7.7"
|
|
66
65
|
gemfile: Gemfile.5.2.mysql2
|
|
67
|
-
|
|
68
66
|
env:
|
|
69
67
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
70
68
|
|
|
71
69
|
steps:
|
|
72
|
-
- uses: actions/checkout@
|
|
70
|
+
- uses: actions/checkout@v3
|
|
73
71
|
- name: Install ruby
|
|
74
72
|
uses: ruby/setup-ruby@v1
|
|
75
73
|
with:
|
|
76
74
|
ruby-version: ${{ matrix.ruby }}
|
|
77
|
-
|
|
78
|
-
run: |
|
|
79
|
-
gem install bundler:2.2.27
|
|
80
|
-
bundle install --no-deployment
|
|
75
|
+
bundler-cache: true
|
|
81
76
|
- name: Setup databases
|
|
82
77
|
run: |
|
|
83
78
|
mysql -e 'create database IF NOT EXISTS active_type_test;' -u root --password=password -P 3306 -h 127.0.0.1
|
|
@@ -106,29 +101,29 @@ jobs:
|
|
|
106
101
|
include:
|
|
107
102
|
- ruby: "2.5.5"
|
|
108
103
|
gemfile: Gemfile.5.2.pg
|
|
109
|
-
- ruby: "2.7.
|
|
104
|
+
- ruby: "2.7.7"
|
|
110
105
|
gemfile: Gemfile.5.2.pg
|
|
111
|
-
- ruby: "3.0.
|
|
106
|
+
- ruby: "3.0.5"
|
|
112
107
|
gemfile: Gemfile.6.1.pg
|
|
113
|
-
- ruby: "3.0.
|
|
108
|
+
- ruby: "3.0.5"
|
|
109
|
+
gemfile: Gemfile.7.0.pg
|
|
110
|
+
- ruby: "3.1.3"
|
|
111
|
+
gemfile: Gemfile.7.0.pg
|
|
112
|
+
- ruby: "3.2.0"
|
|
114
113
|
gemfile: Gemfile.7.0.pg
|
|
115
|
-
|
|
116
114
|
env:
|
|
117
115
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
118
116
|
|
|
119
117
|
steps:
|
|
120
|
-
- uses: actions/checkout@
|
|
118
|
+
- uses: actions/checkout@v3
|
|
119
|
+
- name: Install database client
|
|
120
|
+
run: |
|
|
121
|
+
sudo apt-get install -y postgresql-client
|
|
121
122
|
- name: Install ruby
|
|
122
123
|
uses: ruby/setup-ruby@v1
|
|
123
124
|
with:
|
|
124
125
|
ruby-version: ${{ matrix.ruby }}
|
|
125
|
-
|
|
126
|
-
run: |
|
|
127
|
-
sudo apt-get install -y postgresql-client
|
|
128
|
-
- name: Bundle
|
|
129
|
-
run: |
|
|
130
|
-
gem install bundler:2.2.27
|
|
131
|
-
bundle install --no-deployment
|
|
126
|
+
bundler-cache: true
|
|
132
127
|
- name: Setup databases
|
|
133
128
|
run: |
|
|
134
129
|
PGPASSWORD=postgres psql -c 'create database active_type_test;' -U postgres -p 5432 -h localhost
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 2.3.3 (2023-05-11)
|
|
6
|
+
|
|
7
|
+
* Fixed: `accepts_nested_attributes_for` ignores virtual attributes. Thanks to @nalabjp.
|
|
8
|
+
|
|
5
9
|
## 2.3.2 (2022-11-17)
|
|
6
10
|
|
|
7
11
|
* Fixed: Allowed some more attribute methods on casted objects without causing a UnmutableAttributes error.
|
data/Gemfile
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Gemfile.7.0.sqlite3
|
data/Gemfile.5.2.mysql2.lock
CHANGED
data/Gemfile.5.2.pg.lock
CHANGED
data/Gemfile.5.2.sqlite3.lock
CHANGED
data/Gemfile.6.0.sqlite3.lock
CHANGED
data/Gemfile.6.1.pg.lock
CHANGED
data/Gemfile.6.1.sqlite3.lock
CHANGED
data/Gemfile.7.0.pg.lock
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
active_type (2.3.
|
|
4
|
+
active_type (2.3.3)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (7.0.4)
|
|
11
|
-
activesupport (= 7.0.4)
|
|
12
|
-
activerecord (7.0.4)
|
|
13
|
-
activemodel (= 7.0.4)
|
|
14
|
-
activesupport (= 7.0.4)
|
|
15
|
-
activesupport (7.0.4)
|
|
10
|
+
activemodel (7.0.4.2)
|
|
11
|
+
activesupport (= 7.0.4.2)
|
|
12
|
+
activerecord (7.0.4.2)
|
|
13
|
+
activemodel (= 7.0.4.2)
|
|
14
|
+
activesupport (= 7.0.4.2)
|
|
15
|
+
activesupport (7.0.4.2)
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
17
|
i18n (>= 1.6, < 2)
|
|
18
18
|
minitest (>= 5.1)
|
|
19
19
|
tzinfo (~> 2.0)
|
|
20
|
-
concurrent-ruby (1.
|
|
20
|
+
concurrent-ruby (1.2.0)
|
|
21
21
|
diff-lcs (1.5.0)
|
|
22
|
-
gemika (0.
|
|
22
|
+
gemika (0.8.1)
|
|
23
23
|
i18n (1.12.0)
|
|
24
24
|
concurrent-ruby (~> 1.0)
|
|
25
|
-
minitest (5.
|
|
26
|
-
pg (1.
|
|
25
|
+
minitest (5.17.0)
|
|
26
|
+
pg (1.4.5)
|
|
27
27
|
rake (13.0.6)
|
|
28
|
-
rspec (3.
|
|
29
|
-
rspec-core (~> 3.
|
|
30
|
-
rspec-expectations (~> 3.
|
|
31
|
-
rspec-mocks (~> 3.
|
|
32
|
-
rspec-core (3.
|
|
33
|
-
rspec-support (~> 3.
|
|
34
|
-
rspec-expectations (3.
|
|
28
|
+
rspec (3.12.0)
|
|
29
|
+
rspec-core (~> 3.12.0)
|
|
30
|
+
rspec-expectations (~> 3.12.0)
|
|
31
|
+
rspec-mocks (~> 3.12.0)
|
|
32
|
+
rspec-core (3.12.0)
|
|
33
|
+
rspec-support (~> 3.12.0)
|
|
34
|
+
rspec-expectations (3.12.2)
|
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
36
|
-
rspec-support (~> 3.
|
|
37
|
-
rspec-mocks (3.
|
|
36
|
+
rspec-support (~> 3.12.0)
|
|
37
|
+
rspec-mocks (3.12.3)
|
|
38
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
-
rspec-support (~> 3.
|
|
40
|
-
rspec-support (3.
|
|
39
|
+
rspec-support (~> 3.12.0)
|
|
40
|
+
rspec-support (3.12.0)
|
|
41
41
|
tzinfo (2.0.5)
|
|
42
42
|
concurrent-ruby (~> 1.0)
|
|
43
43
|
|
|
@@ -53,4 +53,4 @@ DEPENDENCIES
|
|
|
53
53
|
rspec (~> 3.4)
|
|
54
54
|
|
|
55
55
|
BUNDLED WITH
|
|
56
|
-
2.
|
|
56
|
+
2.4.5
|
data/Gemfile.7.0.sqlite3.lock
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
active_type (2.3.
|
|
4
|
+
active_type (2.3.3)
|
|
5
5
|
activerecord (>= 3.2)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
activemodel (7.0.4)
|
|
11
|
-
activesupport (= 7.0.4)
|
|
12
|
-
activerecord (7.0.4)
|
|
13
|
-
activemodel (= 7.0.4)
|
|
14
|
-
activesupport (= 7.0.4)
|
|
15
|
-
activesupport (7.0.4)
|
|
10
|
+
activemodel (7.0.4.3)
|
|
11
|
+
activesupport (= 7.0.4.3)
|
|
12
|
+
activerecord (7.0.4.3)
|
|
13
|
+
activemodel (= 7.0.4.3)
|
|
14
|
+
activesupport (= 7.0.4.3)
|
|
15
|
+
activesupport (7.0.4.3)
|
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
17
17
|
i18n (>= 1.6, < 2)
|
|
18
18
|
minitest (>= 5.1)
|
|
19
19
|
tzinfo (~> 2.0)
|
|
20
|
-
concurrent-ruby (1.
|
|
20
|
+
concurrent-ruby (1.2.2)
|
|
21
21
|
diff-lcs (1.5.0)
|
|
22
|
-
gemika (0.
|
|
23
|
-
i18n (1.
|
|
22
|
+
gemika (0.8.1)
|
|
23
|
+
i18n (1.13.0)
|
|
24
24
|
concurrent-ruby (~> 1.0)
|
|
25
|
-
|
|
25
|
+
mini_portile2 (2.8.1)
|
|
26
|
+
minitest (5.18.0)
|
|
26
27
|
rake (13.0.6)
|
|
27
|
-
rspec (3.
|
|
28
|
-
rspec-core (~> 3.
|
|
29
|
-
rspec-expectations (~> 3.
|
|
30
|
-
rspec-mocks (~> 3.
|
|
31
|
-
rspec-core (3.
|
|
32
|
-
rspec-support (~> 3.
|
|
33
|
-
rspec-expectations (3.
|
|
28
|
+
rspec (3.12.0)
|
|
29
|
+
rspec-core (~> 3.12.0)
|
|
30
|
+
rspec-expectations (~> 3.12.0)
|
|
31
|
+
rspec-mocks (~> 3.12.0)
|
|
32
|
+
rspec-core (3.12.0)
|
|
33
|
+
rspec-support (~> 3.12.0)
|
|
34
|
+
rspec-expectations (3.12.2)
|
|
34
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.
|
|
36
|
-
rspec-mocks (3.
|
|
36
|
+
rspec-support (~> 3.12.0)
|
|
37
|
+
rspec-mocks (3.12.3)
|
|
37
38
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-support (3.
|
|
40
|
-
sqlite3 (1.
|
|
41
|
-
|
|
39
|
+
rspec-support (~> 3.12.0)
|
|
40
|
+
rspec-support (3.12.0)
|
|
41
|
+
sqlite3 (1.6.0)
|
|
42
|
+
mini_portile2 (~> 2.8.0)
|
|
43
|
+
tzinfo (2.0.6)
|
|
42
44
|
concurrent-ruby (~> 1.0)
|
|
43
45
|
|
|
44
46
|
PLATFORMS
|
|
@@ -53,4 +55,4 @@ DEPENDENCIES
|
|
|
53
55
|
sqlite3
|
|
54
56
|
|
|
55
57
|
BUNDLED WITH
|
|
56
|
-
2.
|
|
58
|
+
2.4.5
|
data/Gemfile.lock
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Gemfile.7.0.sqlite3.lock
|
data/active_type.gemspec
CHANGED
|
@@ -10,7 +10,12 @@ Gem::Specification.new do |s|
|
|
|
10
10
|
s.summary = 'Make any Ruby object quack like ActiveRecord'
|
|
11
11
|
s.description = s.summary
|
|
12
12
|
s.license = 'MIT'
|
|
13
|
-
s.metadata = {
|
|
13
|
+
s.metadata = {
|
|
14
|
+
'source_code_uri' => s.homepage,
|
|
15
|
+
'bug_tracker_uri' => s.homepage + '/issues',
|
|
16
|
+
'changelog_uri' => s.homepage + '/blob/master/CHANGELOG.md',
|
|
17
|
+
'rubygems_mfa_required' => 'true',
|
|
18
|
+
}
|
|
14
19
|
|
|
15
20
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
16
21
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
data/lib/active_type/version.rb
CHANGED
|
@@ -218,10 +218,6 @@ module ActiveType
|
|
|
218
218
|
end
|
|
219
219
|
end
|
|
220
220
|
|
|
221
|
-
def attribute_names
|
|
222
|
-
super + self.class._virtual_column_names
|
|
223
|
-
end
|
|
224
|
-
|
|
225
221
|
def changed?
|
|
226
222
|
self.class._virtual_column_names.any? { |attr| virtual_attributes_were[attr] != send(attr) } || super
|
|
227
223
|
end
|
|
@@ -287,6 +283,14 @@ module ActiveType
|
|
|
287
283
|
end
|
|
288
284
|
end
|
|
289
285
|
|
|
286
|
+
private
|
|
287
|
+
|
|
288
|
+
if ActiveRecord::Base.private_method_defined?(:attribute_names_for_serialization)
|
|
289
|
+
def attribute_names_for_serialization
|
|
290
|
+
super + self.class._virtual_column_names
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
290
294
|
|
|
291
295
|
module ClassMethods
|
|
292
296
|
|
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: 2.3.
|
|
4
|
+
version: 2.3.3
|
|
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: 2023-05-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|
|
@@ -109,6 +109,9 @@ homepage: https://github.com/makandra/active_type
|
|
|
109
109
|
licenses:
|
|
110
110
|
- MIT
|
|
111
111
|
metadata:
|
|
112
|
+
source_code_uri: https://github.com/makandra/active_type
|
|
113
|
+
bug_tracker_uri: https://github.com/makandra/active_type/issues
|
|
114
|
+
changelog_uri: https://github.com/makandra/active_type/blob/master/CHANGELOG.md
|
|
112
115
|
rubygems_mfa_required: 'true'
|
|
113
116
|
post_install_message:
|
|
114
117
|
rdoc_options: []
|
|
@@ -125,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
125
128
|
- !ruby/object:Gem::Version
|
|
126
129
|
version: '0'
|
|
127
130
|
requirements: []
|
|
128
|
-
rubygems_version: 3.2.
|
|
131
|
+
rubygems_version: 3.2.33
|
|
129
132
|
signing_key:
|
|
130
133
|
specification_version: 4
|
|
131
134
|
summary: Make any Ruby object quack like ActiveRecord
|