active_type 2.5.0 → 2.5.1

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: 9b40a092b72f6361e4693545466f24456c99e8bcb99544b151ea3f2d7fc81dba
4
- data.tar.gz: 25e7245a8e46d79a7ceb1e7de19c869e8cee5af3aabca774db5bd12e500e6a97
3
+ metadata.gz: f243c433c673eb72dc622d9315f8a68a33b788a4f20cb82a5b480dc82ccb73b9
4
+ data.tar.gz: f8f6b146776a25cfbcbb3acf8c9fafa46c22e68136ed23a9a004a75af0cf6e05
5
5
  SHA512:
6
- metadata.gz: 15b0593912cfafd848d498cc9095928e30f925b5e1fdc82c1bdbb0e34e543f5b5f6ae981f003bd9eece9e8f3ab957daaf0b779980002b847bea73296719de286
7
- data.tar.gz: 7b823c166979fe0786e455a39e81cf633db3784aa91a47e9c34491082489e7a7049e2997c46cc9470830fccab063c7ac693feba97eab897cea995d675cae12ae
6
+ metadata.gz: e4035273c367cb091908f5ad2db1949970e8e323b72629580a11e8309f48aa5ec4eb45e54a7e0c0896cf508c394ac6a0e72b51dc059a1b644751c400964f8319
7
+ data.tar.gz: 9b79ccb1b3bbdc6dd0ad6c0cec7254a5ed41f18d41020a5c774a021eb898fe721fe3c7918b73253ac88689c54a1430b74f56babc1f40aaad5a705ccf81e55424
@@ -28,6 +28,10 @@ jobs:
28
28
  gemfile: Gemfile.7.0.sqlite3
29
29
  - ruby: "3.2.0"
30
30
  gemfile: Gemfile.7.0.sqlite3
31
+ - ruby: "3.2.0"
32
+ gemfile: Gemfile.7.1.sqlite3
33
+ - ruby: "3.2.0"
34
+ gemfile: Gemfile.7.2.sqlite3
31
35
  env:
32
36
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
33
37
 
@@ -112,6 +116,10 @@ jobs:
112
116
  gemfile: Gemfile.7.0.pg
113
117
  - ruby: "3.2.0"
114
118
  gemfile: Gemfile.7.0.pg
119
+ - ruby: "3.2.0"
120
+ gemfile: Gemfile.7.1.pg
121
+ - ruby: "3.2.0"
122
+ gemfile: Gemfile.7.2.pg
115
123
  env:
116
124
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
117
125
 
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0
1
+ 3.2
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.5.1 (2024-08-14)
6
+
7
+ * Fixed: Make `ActiveType::Object` work on Rails 7.2.
8
+
5
9
  ## 2.5.0 (2024-02-29)
6
10
 
7
11
  * Passing unfrozen objects as a default for an attribute is deprecated, since these objects might be shared between records.
@@ -11,6 +15,7 @@ All notable changes to this project will be documented in this file.
11
15
  * Fixed: Calling `#attributes` on the base record after a cast works now and does not throw a `MutationAfterCastError`
12
16
 
13
17
  ## 2.4.0 (2023-12-22)
18
+
14
19
  * Added: You can implement an `#after_cast` that is called with the original record when calling `ActiveType.cast`.
15
20
  Thanks to @MaximilianoGarciaRoe.
16
21
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.5.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.6.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.7.0.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- active_type (2.5.0)
4
+ active_type (2.5.1)
5
5
  activerecord (>= 3.2)
6
6
 
7
7
  GEM
data/Gemfile.7.1.pg ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>7.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,68 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.5.1)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.1.3.4)
11
+ activesupport (= 7.1.3.4)
12
+ activerecord (7.1.3.4)
13
+ activemodel (= 7.1.3.4)
14
+ activesupport (= 7.1.3.4)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.1.3.4)
17
+ base64
18
+ bigdecimal
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ connection_pool (>= 2.2.5)
21
+ drb
22
+ i18n (>= 1.6, < 2)
23
+ minitest (>= 5.1)
24
+ mutex_m
25
+ tzinfo (~> 2.0)
26
+ base64 (0.2.0)
27
+ bigdecimal (3.1.8)
28
+ concurrent-ruby (1.3.4)
29
+ connection_pool (2.4.1)
30
+ diff-lcs (1.5.1)
31
+ drb (2.2.1)
32
+ gemika (0.8.3)
33
+ i18n (1.14.5)
34
+ concurrent-ruby (~> 1.0)
35
+ minitest (5.24.1)
36
+ mutex_m (0.2.0)
37
+ pg (1.5.7)
38
+ rake (13.2.1)
39
+ rspec (3.13.0)
40
+ rspec-core (~> 3.13.0)
41
+ rspec-expectations (~> 3.13.0)
42
+ rspec-mocks (~> 3.13.0)
43
+ rspec-core (3.13.0)
44
+ rspec-support (~> 3.13.0)
45
+ rspec-expectations (3.13.1)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-mocks (3.13.1)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-support (3.13.1)
52
+ timeout (0.4.1)
53
+ tzinfo (2.0.6)
54
+ concurrent-ruby (~> 1.0)
55
+
56
+ PLATFORMS
57
+ ruby
58
+
59
+ DEPENDENCIES
60
+ active_type!
61
+ activerecord (~> 7.1.0)
62
+ gemika
63
+ pg
64
+ rake
65
+ rspec (~> 3.4)
66
+
67
+ BUNDLED WITH
68
+ 2.5.6
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>7.1.0'
4
+ gem 'rspec', '~>3.4'
5
+ gem 'sqlite3', '=1.6.0'
6
+ gem 'rake'
7
+ gem 'gemika'
8
+
9
+ gem 'active_type', :path => '.'
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.5.1)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.1.3.4)
11
+ activesupport (= 7.1.3.4)
12
+ activerecord (7.1.3.4)
13
+ activemodel (= 7.1.3.4)
14
+ activesupport (= 7.1.3.4)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.1.3.4)
17
+ base64
18
+ bigdecimal
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ connection_pool (>= 2.2.5)
21
+ drb
22
+ i18n (>= 1.6, < 2)
23
+ minitest (>= 5.1)
24
+ mutex_m
25
+ tzinfo (~> 2.0)
26
+ base64 (0.2.0)
27
+ bigdecimal (3.1.8)
28
+ concurrent-ruby (1.3.4)
29
+ connection_pool (2.4.1)
30
+ diff-lcs (1.5.1)
31
+ drb (2.2.1)
32
+ gemika (0.8.3)
33
+ i18n (1.14.5)
34
+ concurrent-ruby (~> 1.0)
35
+ mini_portile2 (2.8.7)
36
+ minitest (5.24.1)
37
+ mutex_m (0.2.0)
38
+ rake (13.2.1)
39
+ rspec (3.13.0)
40
+ rspec-core (~> 3.13.0)
41
+ rspec-expectations (~> 3.13.0)
42
+ rspec-mocks (~> 3.13.0)
43
+ rspec-core (3.13.0)
44
+ rspec-support (~> 3.13.0)
45
+ rspec-expectations (3.13.1)
46
+ diff-lcs (>= 1.2.0, < 2.0)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-mocks (3.13.1)
49
+ diff-lcs (>= 1.2.0, < 2.0)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-support (3.13.1)
52
+ sqlite3 (1.6.0)
53
+ mini_portile2 (~> 2.8.0)
54
+ timeout (0.4.1)
55
+ tzinfo (2.0.6)
56
+ concurrent-ruby (~> 1.0)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ active_type!
63
+ activerecord (~> 7.1.0)
64
+ gemika
65
+ rake
66
+ rspec (~> 3.4)
67
+ sqlite3 (= 1.6.0)
68
+
69
+ BUNDLED WITH
70
+ 2.5.6
data/Gemfile.7.2.pg ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>7.2.0'
4
+ gem 'rspec', '~>3.4'
5
+ gem 'pg'
6
+ gem 'rake'
7
+ gem 'gemika'
8
+
9
+ gem 'active_type', :path => '.'
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.5.1)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.2.0)
11
+ activesupport (= 7.2.0)
12
+ activerecord (7.2.0)
13
+ activemodel (= 7.2.0)
14
+ activesupport (= 7.2.0)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.2.0)
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
+ logger (>= 1.4.2)
24
+ minitest (>= 5.1)
25
+ securerandom (>= 0.3)
26
+ tzinfo (~> 2.0, >= 2.0.5)
27
+ base64 (0.2.0)
28
+ bigdecimal (3.1.8)
29
+ concurrent-ruby (1.3.4)
30
+ connection_pool (2.4.1)
31
+ diff-lcs (1.5.1)
32
+ drb (2.2.1)
33
+ gemika (0.8.3)
34
+ i18n (1.14.5)
35
+ concurrent-ruby (~> 1.0)
36
+ logger (1.6.0)
37
+ minitest (5.24.1)
38
+ pg (1.5.7)
39
+ rake (13.2.1)
40
+ rspec (3.13.0)
41
+ rspec-core (~> 3.13.0)
42
+ rspec-expectations (~> 3.13.0)
43
+ rspec-mocks (~> 3.13.0)
44
+ rspec-core (3.13.0)
45
+ rspec-support (~> 3.13.0)
46
+ rspec-expectations (3.13.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-mocks (3.13.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-support (3.13.1)
53
+ securerandom (0.3.1)
54
+ timeout (0.4.1)
55
+ tzinfo (2.0.6)
56
+ concurrent-ruby (~> 1.0)
57
+
58
+ PLATFORMS
59
+ ruby
60
+
61
+ DEPENDENCIES
62
+ active_type!
63
+ activerecord (~> 7.2.0)
64
+ gemika
65
+ pg
66
+ rake
67
+ rspec (~> 3.4)
68
+
69
+ BUNDLED WITH
70
+ 2.5.6
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activerecord', '~>7.2.0'
4
+ gem 'rspec', '~>3.4'
5
+ gem 'sqlite3', '=1.6.0'
6
+ gem 'rake'
7
+ gem 'gemika'
8
+
9
+ gem 'active_type', :path => '.'
@@ -0,0 +1,72 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ active_type (2.5.1)
5
+ activerecord (>= 3.2)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ activemodel (7.2.0)
11
+ activesupport (= 7.2.0)
12
+ activerecord (7.2.0)
13
+ activemodel (= 7.2.0)
14
+ activesupport (= 7.2.0)
15
+ timeout (>= 0.4.0)
16
+ activesupport (7.2.0)
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
+ logger (>= 1.4.2)
24
+ minitest (>= 5.1)
25
+ securerandom (>= 0.3)
26
+ tzinfo (~> 2.0, >= 2.0.5)
27
+ base64 (0.2.0)
28
+ bigdecimal (3.1.8)
29
+ concurrent-ruby (1.3.4)
30
+ connection_pool (2.4.1)
31
+ diff-lcs (1.5.1)
32
+ drb (2.2.1)
33
+ gemika (0.8.3)
34
+ i18n (1.14.5)
35
+ concurrent-ruby (~> 1.0)
36
+ logger (1.6.0)
37
+ mini_portile2 (2.8.7)
38
+ minitest (5.24.1)
39
+ rake (13.2.1)
40
+ rspec (3.13.0)
41
+ rspec-core (~> 3.13.0)
42
+ rspec-expectations (~> 3.13.0)
43
+ rspec-mocks (~> 3.13.0)
44
+ rspec-core (3.13.0)
45
+ rspec-support (~> 3.13.0)
46
+ rspec-expectations (3.13.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.13.0)
49
+ rspec-mocks (3.13.1)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.13.0)
52
+ rspec-support (3.13.1)
53
+ securerandom (0.3.1)
54
+ sqlite3 (1.6.0)
55
+ mini_portile2 (~> 2.8.0)
56
+ timeout (0.4.1)
57
+ tzinfo (2.0.6)
58
+ concurrent-ruby (~> 1.0)
59
+
60
+ PLATFORMS
61
+ ruby
62
+
63
+ DEPENDENCIES
64
+ active_type!
65
+ activerecord (~> 7.2.0)
66
+ gemika
67
+ rake
68
+ rspec (~> 3.4)
69
+ sqlite3 (= 1.6.0)
70
+
71
+ BUNDLED WITH
72
+ 2.5.6
data/README.md CHANGED
@@ -381,12 +381,13 @@ sign_up.is_a?(SignUp) # => true
381
381
 
382
382
  If you need to add some special logic after casting you can add an `after_cast` method:
383
383
 
384
+ ```ruby
384
385
  class SignUp < ActiveType::Record[User]
385
386
  def after_cast(user)
386
387
  # Called with the original user upon casting.
387
388
  end
388
389
  end
389
-
390
+ ```
390
391
 
391
392
 
392
393
  Associations
@@ -395,7 +396,7 @@ Associations
395
396
  Sometimes, you have an association, and a form model for that association. Instead of always casting the associations manually, you can use the `change_association` macro to override an association's options. For example.
396
397
 
397
398
 
398
- ```
399
+ ```ruby
399
400
  class Credential < ActiveRecord::Base
400
401
  end
401
402
 
@@ -132,6 +132,10 @@ module ActiveType
132
132
  @connection ||= DummyConnection.new(nil)
133
133
  end
134
134
 
135
+ def with_connection(**)
136
+ yield(connection)
137
+ end
138
+
135
139
  def destroy(*)
136
140
  new
137
141
  end
@@ -148,6 +152,13 @@ module ActiveType
148
152
  []
149
153
  end
150
154
 
155
+ def cached_find_by(*)
156
+ nil
157
+ end
158
+
159
+ def schema_cache
160
+ DummySchemaCache.new
161
+ end
151
162
  end
152
163
 
153
164
  def destroy
@@ -28,6 +28,10 @@ module ActiveType
28
28
  original_attributes.key?(key)
29
29
  end
30
30
 
31
+ def keys
32
+ original_attributes.keys
33
+ end
34
+
31
35
  def method_missing(*args)
32
36
  raise MutationAfterCastError, 'Changing a record that has been used to create an ActiveType::Record could have unexpected side effects!'
33
37
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveType
2
- VERSION = '2.5.0'
2
+ VERSION = '2.5.1'
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.5.0
4
+ version: 2.5.1
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: 2024-02-29 00:00:00.000000000 Z
12
+ date: 2024-08-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -81,6 +81,14 @@ files:
81
81
  - Gemfile.7.0.pg.lock
82
82
  - Gemfile.7.0.sqlite3
83
83
  - Gemfile.7.0.sqlite3.lock
84
+ - Gemfile.7.1.pg
85
+ - Gemfile.7.1.pg.lock
86
+ - Gemfile.7.1.sqlite3
87
+ - Gemfile.7.1.sqlite3.lock
88
+ - Gemfile.7.2.pg
89
+ - Gemfile.7.2.pg.lock
90
+ - Gemfile.7.2.sqlite3
91
+ - Gemfile.7.2.sqlite3.lock
84
92
  - Gemfile.lock
85
93
  - LICENSE
86
94
  - README.md
@@ -128,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
136
  - !ruby/object:Gem::Version
129
137
  version: '0'
130
138
  requirements: []
131
- rubygems_version: 3.2.33
139
+ rubygems_version: 3.4.10
132
140
  signing_key:
133
141
  specification_version: 4
134
142
  summary: Make any Ruby object quack like ActiveRecord