deep_cloneable 3.2.1 → 3.2.2
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/Appraisals +2 -51
- data/CHANGELOG.md +11 -0
- data/Gemfile +2 -3
- data/Gemfile.lock +22 -22
- data/LICENSE +1 -1
- data/lib/deep_cloneable/version.rb +1 -1
- data/readme.md +21 -5
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f3e467c8c20de2d308cce08edca4b9a62287d3bd12b5ad6bca682bfa8a69021
|
|
4
|
+
data.tar.gz: 97021542287799a710e83dda314777a1efc9a591cffb39e23d9cb2a770f6f1cb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 133f0cba36cfa6245d37f432bebd4b698445785db33c395a3f3d2c55bda605718a3718cef1131d0a9800361c87cbfc1d6187a66357fd74983e4052712d57a45b
|
|
7
|
+
data.tar.gz: 21dadd156be7bb100022d9598cf53c611377bc760e070beed3f52fa707a08564aebd5e4a90c157f8daafc021b55aa5790e3d93527d18a740b77b94fe98e7138d
|
data/Appraisals
CHANGED
|
@@ -1,55 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
gem 'activerecord', '~> 3.2.0'
|
|
5
|
-
gem 'i18n', '~> 0.6.5'
|
|
6
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
appraise '4.0' do
|
|
10
|
-
gem 'activerecord', '~> 4.0.0'
|
|
11
|
-
gem 'i18n', '~> 0.6.5'
|
|
12
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
appraise '4.1' do
|
|
16
|
-
gem 'activerecord', '~> 4.1.0'
|
|
17
|
-
gem 'i18n', '~> 0.6.9'
|
|
18
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
appraise '4.2' do
|
|
22
|
-
gem 'activerecord', '~> 4.2.3'
|
|
23
|
-
gem 'i18n', '~> 0.7.0'
|
|
24
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
appraise '5.0' do
|
|
28
|
-
gem 'activerecord', '~> 5.0.0'
|
|
29
|
-
gem 'i18n', '~> 0.7.0'
|
|
30
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
appraise '5.1' do
|
|
34
|
-
gem 'activerecord', '~> 5.1.0'
|
|
35
|
-
gem 'i18n', '~> 0.7.0'
|
|
36
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
appraise '5.2' do
|
|
40
|
-
gem 'activerecord', '~> 5.2.0'
|
|
41
|
-
gem 'i18n', '~> 0.7.0'
|
|
42
|
-
gem 'sqlite3', '~> 1.3.13'
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
appraise '6.0' do
|
|
46
|
-
gem 'activerecord', '~> 6.0.0'
|
|
47
|
-
gem 'sqlite3', '~> 1.4.1'
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
appraise '7.0' do
|
|
51
|
-
gem 'activerecord', '~> 7.0.0'
|
|
52
|
-
gem 'sqlite3', '~> 1.4.1'
|
|
2
|
+
appraise '7.1' do
|
|
3
|
+
gem 'activerecord', '~> 7.1.0'
|
|
53
4
|
end
|
|
54
5
|
|
|
55
6
|
appraise '8.0' do
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.2.2] - 2026-02-19
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Bump uri dependency to 1.0.3 to address CVE-2025-27221
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
- Removed EOL ruby versions from test build
|
|
19
|
+
- Removed EOL rails versions from test build
|
|
20
|
+
|
|
10
21
|
## [3.2.1] - 2024-11-20
|
|
11
22
|
|
|
12
23
|
### Added
|
data/Gemfile
CHANGED
|
@@ -4,8 +4,7 @@ source 'http://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
gem 'activerecord', '>= 3.1.0', '< 9'
|
|
6
6
|
gem 'bundler', :group => :test
|
|
7
|
-
gem 'rake', '~> 12.3', :group => :test
|
|
8
|
-
|
|
9
7
|
gem 'appraisal', :group => :test
|
|
10
8
|
gem 'minitest', :group => :test
|
|
11
|
-
gem 'sqlite3',
|
|
9
|
+
gem 'sqlite3', :group => :test
|
|
10
|
+
gem 'logger', :group => :test
|
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
activemodel (8.0.
|
|
5
|
-
activesupport (= 8.0.
|
|
6
|
-
activerecord (8.0.
|
|
7
|
-
activemodel (= 8.0.
|
|
8
|
-
activesupport (= 8.0.
|
|
4
|
+
activemodel (8.0.2)
|
|
5
|
+
activesupport (= 8.0.2)
|
|
6
|
+
activerecord (8.0.2)
|
|
7
|
+
activemodel (= 8.0.2)
|
|
8
|
+
activesupport (= 8.0.2)
|
|
9
9
|
timeout (>= 0.4.0)
|
|
10
|
-
activesupport (8.0.
|
|
10
|
+
activesupport (8.0.2)
|
|
11
11
|
base64
|
|
12
12
|
benchmark (>= 0.3)
|
|
13
13
|
bigdecimal
|
|
@@ -24,26 +24,26 @@ GEM
|
|
|
24
24
|
bundler
|
|
25
25
|
rake
|
|
26
26
|
thor (>= 0.14.0)
|
|
27
|
-
base64 (0.
|
|
28
|
-
benchmark (0.4.
|
|
29
|
-
bigdecimal (3.
|
|
30
|
-
concurrent-ruby (1.3.
|
|
31
|
-
connection_pool (2.
|
|
32
|
-
drb (2.2.
|
|
33
|
-
i18n (1.14.
|
|
27
|
+
base64 (0.3.0)
|
|
28
|
+
benchmark (0.4.1)
|
|
29
|
+
bigdecimal (3.2.2)
|
|
30
|
+
concurrent-ruby (1.3.5)
|
|
31
|
+
connection_pool (2.5.3)
|
|
32
|
+
drb (2.2.3)
|
|
33
|
+
i18n (1.14.7)
|
|
34
34
|
concurrent-ruby (~> 1.0)
|
|
35
|
-
logger (1.
|
|
36
|
-
mini_portile2 (2.8.
|
|
37
|
-
minitest (5.25.
|
|
38
|
-
rake (
|
|
39
|
-
securerandom (0.
|
|
35
|
+
logger (1.7.0)
|
|
36
|
+
mini_portile2 (2.8.8)
|
|
37
|
+
minitest (5.25.5)
|
|
38
|
+
rake (13.3.0)
|
|
39
|
+
securerandom (0.4.1)
|
|
40
40
|
sqlite3 (2.2.0)
|
|
41
41
|
mini_portile2 (~> 2.8.0)
|
|
42
42
|
thor (1.3.2)
|
|
43
|
-
timeout (0.4.
|
|
43
|
+
timeout (0.4.3)
|
|
44
44
|
tzinfo (2.0.6)
|
|
45
45
|
concurrent-ruby (~> 1.0)
|
|
46
|
-
uri (1.0.
|
|
46
|
+
uri (1.0.3)
|
|
47
47
|
|
|
48
48
|
PLATFORMS
|
|
49
49
|
ruby
|
|
@@ -52,9 +52,9 @@ DEPENDENCIES
|
|
|
52
52
|
activerecord (>= 3.1.0, < 9)
|
|
53
53
|
appraisal
|
|
54
54
|
bundler
|
|
55
|
+
logger
|
|
55
56
|
minitest
|
|
56
|
-
|
|
57
|
-
sqlite3 (~> 2.2)
|
|
57
|
+
sqlite3
|
|
58
58
|
|
|
59
59
|
BUNDLED WITH
|
|
60
60
|
2.5.20
|
data/LICENSE
CHANGED
data/readme.md
CHANGED
|
@@ -6,16 +6,15 @@ This gem gives every ActiveRecord::Base object the possibility to do a deep clon
|
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
|
-
- Ruby
|
|
10
|
-
- Activerecord 3.
|
|
11
|
-
- Rails 2.x/3.0 users, please check out the 'rails2.x-3.0' branch
|
|
9
|
+
- Ruby >= 2 (3.3.5, 3.4.4 tested)
|
|
10
|
+
- Activerecord >= 3.1.0 (7.1, 8.0 tested)
|
|
12
11
|
|
|
13
12
|
## Installation
|
|
14
13
|
|
|
15
14
|
- Add deep_cloneable to your Gemfile:
|
|
16
15
|
|
|
17
16
|
```ruby
|
|
18
|
-
gem 'deep_cloneable', '~> 3.2.
|
|
17
|
+
gem 'deep_cloneable', '~> 3.2.2'
|
|
19
18
|
```
|
|
20
19
|
|
|
21
20
|
## Upgrade details
|
|
@@ -150,6 +149,23 @@ pirate.deep_clone include: :parrot do |original, kopy|
|
|
|
150
149
|
end
|
|
151
150
|
```
|
|
152
151
|
|
|
152
|
+
#### Shrine
|
|
153
|
+
|
|
154
|
+
Shrine is similar to Carrierwave, but you have to clear the `image_data` hash attribute from the copy, otherwise Shrine will think there's an old attachment to clean up and will delete the original image.
|
|
155
|
+
|
|
156
|
+
```ruby
|
|
157
|
+
pirate.deep_clone include: [:photos, :parrot] do |original, kopy|
|
|
158
|
+
if kopy.is_a?(Photo)
|
|
159
|
+
kopy.image_data = nil
|
|
160
|
+
kopy.image = original.image
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Note you're not assigning `image_data` directly, otherwise this would result in both records sharing the same asset in your storage.
|
|
166
|
+
|
|
167
|
+
Directly assigning `kopy.image` to `original.image` ensures you use your usual uploading mechanism, such as background jobs.
|
|
168
|
+
|
|
153
169
|
#### ActiveStorage
|
|
154
170
|
|
|
155
171
|
For ActiveStorage, you have two options: you can either make a full copy, or share data blobs between two records.
|
|
@@ -239,4 +255,4 @@ pirate.deep_clone include: [:parrot, :rum], skip_missing_associations: true
|
|
|
239
255
|
|
|
240
256
|
### Copyright
|
|
241
257
|
|
|
242
|
-
Copyright ©
|
|
258
|
+
Copyright © 2026 Reinier de Lange. See LICENSE for details.
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: deep_cloneable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.2.
|
|
4
|
+
version: 3.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Reinier de Lange
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activerecord
|
|
@@ -56,7 +55,6 @@ homepage: https://github.com/moiristo/deep_cloneable
|
|
|
56
55
|
licenses:
|
|
57
56
|
- MIT
|
|
58
57
|
metadata: {}
|
|
59
|
-
post_install_message:
|
|
60
58
|
rdoc_options: []
|
|
61
59
|
require_paths:
|
|
62
60
|
- lib
|
|
@@ -71,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
69
|
- !ruby/object:Gem::Version
|
|
72
70
|
version: '0'
|
|
73
71
|
requirements: []
|
|
74
|
-
rubygems_version:
|
|
75
|
-
signing_key:
|
|
72
|
+
rubygems_version: 4.0.6
|
|
76
73
|
specification_version: 4
|
|
77
74
|
summary: This gem gives every ActiveRecord::Base object the possibility to do a deep
|
|
78
75
|
clone.
|