active_type 2.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0d4c00a8c504822572083cb1a051ff4582c5e0638bc4eca0f064df38f175b2e
4
- data.tar.gz: b38c8570c9ecf88d267ae7f6e46bd1773c5658494a329b6ae00de114ce274d01
3
+ metadata.gz: 4ed97bd5057f4193d1ced6df666bc9250c4d57cbf830db65112c7686311ed2e5
4
+ data.tar.gz: 9b38760b9e205770507223ef9c11aae1813abb078b48e6a9e5bb5210a6fa464b
5
5
  SHA512:
6
- metadata.gz: 925a22fc4566431fc6fa4c3a22cdb86d2889e2c6066ece8a652b98fc8b2a81267c3c4221dc3429bbae7cc34bf9a14534d75b6f0e286c78b95909e581a27e840b
7
- data.tar.gz: '097eafa44f1c006d76185d0e697bcca2072e820e019c84327432e18d4bf767925f69b988c468a82978fc5cfcfe2a21751b714dd2914adbcc94065ca70aba4a09'
6
+ metadata.gz: 79d3b07256931a655d9a761485ffeb5a630442a83e13b12d44b519f4f485d5b05485c457273de50e9381ca8beddc9b1d6368c901b5ba121fc7761910b9f3c81a
7
+ data.tar.gz: 2c36129837464338002cb14c90442654ec7dc3b647ee4c9f01ace6b5611018600edd37927ce9882051336c54a54169cd1e4292e7c7e819e3e914170ea1720de4
@@ -2,9 +2,9 @@ name: Tests
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [ master ]
5
+ branches: [master]
6
6
  pull_request:
7
- branches: [ master ]
7
+ branches: [master]
8
8
 
9
9
  jobs:
10
10
  test_sqlite:
@@ -28,16 +28,22 @@ jobs:
28
28
  gemfile: Gemfile.6.0.sqlite3
29
29
  - ruby: "2.6.3"
30
30
  gemfile: Gemfile.6.1.sqlite3
31
- - ruby: "2.7.2"
31
+ - ruby: "2.6.3"
32
+ gemfile: Gemfile.7.0.sqlite3
33
+ - ruby: "2.7.4"
32
34
  gemfile: Gemfile.5.2.sqlite3
33
- - ruby: "2.7.2"
35
+ - ruby: "2.7.4"
34
36
  gemfile: Gemfile.6.0.sqlite3
35
- - ruby: "2.7.2"
37
+ - ruby: "2.7.4"
36
38
  gemfile: Gemfile.6.1.sqlite3
39
+ - ruby: "2.7.4"
40
+ gemfile: Gemfile.7.0.sqlite3
37
41
  - ruby: "3.0.1"
38
42
  gemfile: Gemfile.6.0.sqlite3
39
43
  - ruby: "3.0.1"
40
44
  gemfile: Gemfile.6.1.sqlite3
45
+ - ruby: "3.0.1"
46
+ gemfile: Gemfile.7.0.sqlite3
41
47
 
42
48
  env:
43
49
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -50,12 +56,11 @@ jobs:
50
56
  ruby-version: ${{ matrix.ruby }}
51
57
  - name: Bundle
52
58
  run: |
53
- gem install bundler:2.0.2
59
+ gem install bundler:2.2.27
54
60
  bundle install --no-deployment
55
61
  - name: Run tests
56
62
  run: bundle exec rake spec
57
63
 
58
-
59
64
  test_mysql:
60
65
  runs-on: ubuntu-20.04
61
66
 
@@ -65,7 +70,7 @@ jobs:
65
70
  env:
66
71
  MYSQL_ROOT_PASSWORD: password
67
72
  ports:
68
- - 3306:3306
73
+ - 3306:3306
69
74
  options: >-
70
75
  --health-cmd="mysqladmin ping"
71
76
  --health-interval=10s
@@ -80,7 +85,7 @@ jobs:
80
85
  gemfile: Gemfile.4.2.mysql2
81
86
  - ruby: "2.6.3"
82
87
  gemfile: Gemfile.5.2.mysql2
83
- - ruby: "2.7.2"
88
+ - ruby: "2.7.4"
84
89
  gemfile: Gemfile.5.2.mysql2
85
90
 
86
91
  env:
@@ -95,10 +100,10 @@ jobs:
95
100
  - name: Install database client
96
101
  run: |
97
102
  sudo apt-get update
98
- sudo apt-get install -y mysql-client libmariadbclient-dev
103
+ sudo apt-get install -y mariadb-client libmariadbclient-dev
99
104
  - name: Bundle
100
105
  run: |
101
- gem install bundler:2.0.2
106
+ gem install bundler:2.2.27
102
107
  bundle install --no-deployment
103
108
  - name: Setup databases
104
109
  run: |
@@ -106,7 +111,6 @@ jobs:
106
111
  - name: Run tests
107
112
  run: bundle exec rake spec
108
113
 
109
-
110
114
  test_pg:
111
115
  runs-on: ubuntu-20.04
112
116
 
@@ -137,12 +141,16 @@ jobs:
137
141
  gemfile: Gemfile.5.2.pg
138
142
  - ruby: "2.6.3"
139
143
  gemfile: Gemfile.6.1.pg
140
- - ruby: "2.7.2"
144
+ - ruby: "2.7.4"
141
145
  gemfile: Gemfile.5.2.pg
142
- - ruby: "2.7.2"
146
+ - ruby: "2.7.4"
143
147
  gemfile: Gemfile.6.1.pg
148
+ - ruby: "2.7.4"
149
+ gemfile: Gemfile.7.0.pg
144
150
  - ruby: "3.0.1"
145
151
  gemfile: Gemfile.6.1.pg
152
+ - ruby: "3.0.1"
153
+ gemfile: Gemfile.7.0.pg
146
154
 
147
155
  env:
148
156
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
@@ -158,7 +166,7 @@ jobs:
158
166
  sudo apt-get install -y postgresql-client
159
167
  - name: Bundle
160
168
  run: |
161
- gem install bundler:2.0.2
169
+ gem install bundler:2.2.27
162
170
  bundle install --no-deployment
163
171
  - name: Setup databases
164
172
  run: |
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 2.7.4
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
+ ## 2.1.0 (2021-12-22)
8
+
9
+ * Fixed: ActiveType now works for Rails 7.
10
+
7
11
  ## 2.0.0 (2021-11-24)
8
12
 
9
13
  * Added: Casting is prevented when the base record has changes in its already loaded associations, because those would be lost. Option `force: true` can be used to override this and still do the cast (this is not recommended).
data/Gemfile.5.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.0)
4
+ active_type (2.1.0)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -56,4 +56,4 @@ DEPENDENCIES
56
56
  rspec (~> 3.4)
57
57
 
58
58
  BUNDLED WITH
59
- 2.2.16
59
+ 2.2.27
data/Gemfile.6.1.pg.lock CHANGED
@@ -44,6 +44,7 @@ GEM
44
44
  zeitwerk (2.4.2)
45
45
 
46
46
  PLATFORMS
47
+ ruby
47
48
  x86_64-linux
48
49
 
49
50
  DEPENDENCIES
@@ -44,6 +44,7 @@ GEM
44
44
  zeitwerk (2.4.2)
45
45
 
46
46
  PLATFORMS
47
+ ruby
47
48
  x86_64-linux
48
49
 
49
50
  DEPENDENCIES
data/Gemfile.7.0.pg ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>6.1.0'
4
+ gem 'rspec', '~>3.4'
5
+ gem 'pg'
6
+ gem 'rake'
7
+ gem 'gemika'
8
+
9
+ gem 'active_type', :path => '.'
@@ -0,0 +1,58 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.0)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (6.1.4.4)
11
+ activesupport (= 6.1.4.4)
12
+ activerecord (6.1.4.4)
13
+ activemodel (= 6.1.4.4)
14
+ activesupport (= 6.1.4.4)
15
+ activesupport (6.1.4.4)
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.9)
22
+ diff-lcs (1.4.4)
23
+ gemika (0.6.1)
24
+ i18n (1.8.11)
25
+ concurrent-ruby (~> 1.0)
26
+ minitest (5.15.0)
27
+ pg (1.2.3)
28
+ rake (13.0.6)
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.3)
42
+ tzinfo (2.0.4)
43
+ concurrent-ruby (~> 1.0)
44
+ zeitwerk (2.5.1)
45
+
46
+ PLATFORMS
47
+ ruby
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.1.4
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>6.1.0'
4
+ gem 'rspec', '~>3.4'
5
+ gem 'sqlite3'
6
+ gem 'rake'
7
+ gem 'gemika'
8
+
9
+ gem 'active_type', :path => '.'
@@ -0,0 +1,58 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.0)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (6.1.4.4)
11
+ activesupport (= 6.1.4.4)
12
+ activerecord (6.1.4.4)
13
+ activemodel (= 6.1.4.4)
14
+ activesupport (= 6.1.4.4)
15
+ activesupport (6.1.4.4)
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.9)
22
+ diff-lcs (1.4.4)
23
+ gemika (0.6.1)
24
+ i18n (1.8.11)
25
+ concurrent-ruby (~> 1.0)
26
+ minitest (5.15.0)
27
+ rake (13.0.6)
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.3)
41
+ sqlite3 (1.4.2)
42
+ tzinfo (2.0.4)
43
+ concurrent-ruby (~> 1.0)
44
+ zeitwerk (2.5.1)
45
+
46
+ PLATFORMS
47
+ ruby
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.1.4
data/README.md CHANGED
@@ -53,7 +53,7 @@ end
53
53
 
54
54
  ### A note on Rails 5+
55
55
 
56
- Rails 5 comes with its own implementation of `.attribute`. This implementation is functionally very
56
+ Rails 5+ comes with its own implementation of `.attribute`. This implementation is functionally very
57
57
  similar, but not identical to ActiveType's.
58
58
 
59
59
  We have decided to continue to use our own implementation. This means that if you use ActiveType, `ActiveRecord::Base.attribute` will be overriden.
data/active_type.gemspec CHANGED
@@ -16,10 +16,10 @@ Gem::Specification.new do |s|
16
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
17
17
  s.require_paths = ["lib"]
18
18
 
19
- s.add_development_dependency "bundler", "~> 1.5"
19
+ s.add_development_dependency "bundler", ">= 1.5"
20
20
  s.add_development_dependency "rake"
21
21
 
22
22
  s.add_runtime_dependency('activerecord', '>= 3.2')
23
23
 
24
- s.required_ruby_version = '>= 1.9.3'
24
+ s.required_ruby_version = '>= 2.5.0'
25
25
  end
@@ -120,7 +120,7 @@ module ActiveType
120
120
  type_name = base_class.type_for_attribute(inheritance_column).cast(type_name)
121
121
  subclass = begin
122
122
  if store_full_sti_class
123
- ActiveSupport::Dependencies.constantize(type_name)
123
+ type_name.constantize
124
124
  else
125
125
  compute_type(type_name)
126
126
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '2.0'
2
+ VERSION = '2.1.0'
3
3
  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: '2.0'
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Kraze
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-11-24 00:00:00.000000000 Z
12
+ date: 2021-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.5'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.5'
28
28
  - !ruby/object:Gem::Dependency
@@ -83,6 +83,10 @@ files:
83
83
  - Gemfile.6.1.pg.lock
84
84
  - Gemfile.6.1.sqlite3
85
85
  - Gemfile.6.1.sqlite3.lock
86
+ - Gemfile.7.0.pg
87
+ - Gemfile.7.0.pg.lock
88
+ - Gemfile.7.0.sqlite3
89
+ - Gemfile.7.0.sqlite3.lock
86
90
  - Gemfile.lock
87
91
  - LICENSE
88
92
  - README.md
@@ -119,14 +123,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
123
  requirements:
120
124
  - - ">="
121
125
  - !ruby/object:Gem::Version
122
- version: 1.9.3
126
+ version: 2.5.0
123
127
  required_rubygems_version: !ruby/object:Gem::Requirement
124
128
  requirements:
125
129
  - - ">="
126
130
  - !ruby/object:Gem::Version
127
131
  version: '0'
128
132
  requirements: []
129
- rubygems_version: 3.2.15
133
+ rubygems_version: 3.2.6
130
134
  signing_key:
131
135
  specification_version: 4
132
136
  summary: Make any Ruby object quack like ActiveRecord