deep_cloneable 3.0.0 → 3.1.0
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 +5 -11
- data/CHANGELOG.md +113 -1
- data/Gemfile +5 -8
- data/Gemfile.lock +4 -52
- data/LICENSE +1 -1
- data/Rakefile +3 -18
- data/deep_cloneable.gemspec +18 -76
- data/init.rb +2 -0
- data/lib/deep_cloneable.rb +2 -0
- data/lib/deep_cloneable/association_not_found_exception.rb +2 -0
- data/lib/deep_cloneable/deep_clone.rb +19 -6
- data/lib/deep_cloneable/skip_validations.rb +2 -0
- data/lib/deep_cloneable/version.rb +3 -0
- data/readme.md +75 -20
- metadata +9 -35
- data/.document +0 -5
- data/.rubocop.yml +0 -20
- data/.travis.yml +0 -100
- data/VERSION +0 -1
- data/gemfiles/3.1.gemfile +0 -17
- data/gemfiles/3.1.gemfile.lock +0 -86
- data/gemfiles/3.2.gemfile +0 -17
- data/gemfiles/3.2.gemfile.lock +0 -86
- data/gemfiles/4.0.gemfile +0 -17
- data/gemfiles/4.0.gemfile.lock +0 -93
- data/gemfiles/4.1.gemfile +0 -17
- data/gemfiles/4.1.gemfile.lock +0 -93
- data/gemfiles/4.2.gemfile +0 -17
- data/gemfiles/4.2.gemfile.lock +0 -91
- data/gemfiles/5.0.gemfile +0 -16
- data/gemfiles/5.0.gemfile.lock +0 -91
- data/gemfiles/5.1.gemfile +0 -16
- data/gemfiles/5.1.gemfile.lock +0 -91
- data/gemfiles/5.2.gemfile +0 -15
- data/gemfiles/5.2.gemfile.lock +0 -91
- data/gemfiles/6.0.gemfile +0 -15
- data/gemfiles/6.0.gemfile.lock +0 -91
- data/test/database.yml +0 -6
- data/test/models.rb +0 -151
- data/test/schema.rb +0 -156
- data/test/test_deep_cloneable.rb +0 -509
- data/test/test_helper.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ab5e4168e665bb1fb1c355db74edd575e13c3a21b43fb3403bfaf473b52a0cb
|
4
|
+
data.tar.gz: 532db121e78af89fd2ab97f4b64d3c26f5760bea51782f8653b76dd3b621bbd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0373631aaff4684b61dfd22c04bcf7d8c81684252cf7c7320074cc5d8bb79aaba8a594ca84ce6742f6d6fafb4507f101453e6e3e529081cb6e3455b873d5f9ca
|
7
|
+
data.tar.gz: 5d288ed325b1579387ac96e087566587f9b47dc84dc0a642549f570e999bd328d6f27cd97d6cff2f9d2f478f05ab651a5ba600c546366e8f14beae909afd5aad
|
data/Appraisals
CHANGED
@@ -1,36 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
appraise '3.1' do
|
2
4
|
gem 'activerecord', '~> 3.1.0'
|
3
|
-
gem 'addressable', '~> 2.3.8'
|
4
5
|
gem 'i18n', '~> 0.6.5'
|
5
|
-
gem 'rdoc', '< 5', :group => :test
|
6
6
|
end
|
7
7
|
|
8
8
|
appraise '3.2' do
|
9
9
|
gem 'activerecord', '~> 3.2.0'
|
10
|
-
gem 'addressable', '~> 2.3.8'
|
11
10
|
gem 'i18n', '~> 0.6.5'
|
12
|
-
gem 'rdoc', '< 5', :group => :test
|
13
11
|
end
|
14
12
|
|
15
13
|
appraise '4.0' do
|
16
14
|
gem 'activerecord', '~> 4.0.0'
|
17
15
|
gem 'i18n', '~> 0.6.5'
|
18
|
-
gem 'psych', '< 3', :group => :test
|
19
|
-
gem 'jeweler', '~> 2.1.1', :group => :test
|
20
16
|
end
|
21
17
|
|
22
18
|
appraise '4.1' do
|
23
19
|
gem 'activerecord', '~> 4.1.0'
|
24
20
|
gem 'i18n', '~> 0.6.9'
|
25
|
-
gem 'psych', '< 3', :group => :test
|
26
|
-
gem 'jeweler', '~> 2.1.1', :group => :test
|
27
21
|
end
|
28
22
|
|
29
23
|
appraise '4.2' do
|
30
24
|
gem 'activerecord', '~> 4.2.3'
|
31
25
|
gem 'i18n', '~> 0.7.0'
|
32
|
-
gem 'psych', '< 3', :group => :test
|
33
|
-
gem 'jeweler', '~> 2.1.1', :group => :test
|
34
26
|
end
|
35
27
|
|
36
28
|
appraise '5.0' do
|
@@ -45,8 +37,10 @@ end
|
|
45
37
|
|
46
38
|
appraise '5.2' do
|
47
39
|
gem 'activerecord', '~> 5.2.0'
|
40
|
+
gem 'i18n', '~> 0.7.0'
|
48
41
|
end
|
49
42
|
|
50
43
|
appraise '6.0' do
|
51
|
-
gem 'activerecord', '~> 6.0.0
|
44
|
+
gem 'activerecord', '~> 6.0.0'
|
45
|
+
gem 'sqlite3', '~> 1.4.1'
|
52
46
|
end
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Changelog
|
2
|
+
|
2
3
|
All notable changes to this project will be documented in this file.
|
3
4
|
|
4
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
@@ -6,53 +7,95 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
7
|
|
7
8
|
## [Unreleased]
|
8
9
|
|
10
|
+
## [3.1.0] - 2021-02-17
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
- Added a `preprocessor` option
|
15
|
+
- Added a `postprocessor` option
|
16
|
+
|
17
|
+
### Fixed
|
18
|
+
|
19
|
+
- Ensure the initial options hash is never modified
|
20
|
+
- When using conditions in combination with array includes, ensure nested includes are not accidentally deleted
|
21
|
+
|
22
|
+
### Removed
|
23
|
+
|
24
|
+
- Removed jeweler as a gem dependency
|
25
|
+
|
9
26
|
## [3.0.0] - 2019-08-18
|
27
|
+
|
10
28
|
### Added
|
29
|
+
|
11
30
|
- Support for Ruby 2.6.3
|
12
31
|
- Support for Ruby 2.5.5
|
13
32
|
- Support for Rails 6.0
|
33
|
+
|
14
34
|
### Changed
|
35
|
+
|
15
36
|
- When using conditions, return `nil` instead of `false` as return value when a condition fails
|
16
37
|
- Refactored gem structure and include in AR using lazy load hooks
|
17
38
|
- Skip validations on save by using module `DeepCloneable::SkipValidations` instead of a code patch
|
18
39
|
- Namespace of `ActiveRecord::Base::DeepCloneable::AssociationNotFoundException` changed to `DeepCloneable::AssociationNotFoundException`
|
19
40
|
- Process optional block after all other processing has been finished
|
41
|
+
|
20
42
|
### Fixed
|
43
|
+
|
21
44
|
- Add the `validate` option to the list of passed dup options to ensure validations are never run on save
|
45
|
+
|
22
46
|
### Removed
|
47
|
+
|
23
48
|
- Official support for ruby 1.8.7, as it is not supported by Travis CI anymore
|
24
49
|
- Official support for ruby 1.9.2, as it is not supported by Travis CI anymore
|
25
50
|
|
26
51
|
## [2.4.0] - 2019-01-10
|
52
|
+
|
27
53
|
### Added
|
54
|
+
|
28
55
|
- Support `has_one` and `has_one - through`
|
56
|
+
|
29
57
|
### Changed
|
58
|
+
|
30
59
|
- Lint code via Rubocop
|
31
60
|
- Refactor code to improve readability
|
32
61
|
- Use HTTPS in the gemspec website URL
|
33
62
|
|
34
63
|
## [2.3.2] - 2018-04-11
|
64
|
+
|
35
65
|
### Added
|
66
|
+
|
36
67
|
- Support for Ruby 2.4 and 2.5
|
37
68
|
- Support for Rails 5.1 and 5.2
|
38
69
|
- CHANGELOG.md
|
39
70
|
|
40
71
|
## [2.3.1] - 2017-10-03
|
72
|
+
|
41
73
|
### Added
|
74
|
+
|
42
75
|
- Documentation on when the optional block is invoked, which is before attributes are excluded
|
76
|
+
|
43
77
|
### Fixed
|
78
|
+
|
44
79
|
- Conditional includes for nested associations
|
45
80
|
|
46
81
|
## [2.3.0] - 2017-06-14
|
82
|
+
|
47
83
|
### Added
|
84
|
+
|
48
85
|
- Support for skipping missing associations
|
86
|
+
|
49
87
|
### Fixed
|
88
|
+
|
50
89
|
- Multikey hashes in include arrays
|
51
90
|
|
52
91
|
## [2.2.2] - 2016-10-10
|
92
|
+
|
53
93
|
### Added
|
94
|
+
|
54
95
|
- Documentation on cloning associated Carrierwave files
|
96
|
+
|
55
97
|
### Changed
|
98
|
+
|
56
99
|
- Use `inverse_of` when defined for finding the reverse association
|
57
100
|
- Cache bundler in Travis
|
58
101
|
- Use index operator for setting column defaults
|
@@ -60,130 +103,199 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
60
103
|
- Bump rails 5.0 appraisal
|
61
104
|
|
62
105
|
## [2.2.1] - 2016-05-27
|
106
|
+
|
63
107
|
### Fixed
|
108
|
+
|
64
109
|
- Properly set column defaults for attributes
|
65
110
|
- Rails 5.0 compatibility
|
66
111
|
|
67
112
|
## [2.2.0] - 2016-01-11
|
113
|
+
|
68
114
|
### Added
|
115
|
+
|
69
116
|
- Support for conditional cloning when using array inclusions
|
117
|
+
|
70
118
|
### Changed
|
119
|
+
|
71
120
|
- Bump rails 4.2 appraisal to 4.2.3
|
72
121
|
|
73
122
|
## [2.1.0] - 2015-03-10
|
123
|
+
|
74
124
|
### Added
|
125
|
+
|
75
126
|
- Support for conditional cloning
|
127
|
+
|
76
128
|
### Changed
|
129
|
+
|
77
130
|
- Check the dictionary before cloning has_many through or habtm associations
|
78
131
|
- Refactor methods to refer to `dup` instead of `clone`
|
79
132
|
|
80
133
|
## [2.0.2] - 2014-12-17
|
134
|
+
|
81
135
|
### Fixed
|
136
|
+
|
82
137
|
- Broken activerecord dependency in gemspec
|
83
138
|
|
84
139
|
## [2.0.1] - 2014-12-17
|
140
|
+
|
85
141
|
### Fixed
|
142
|
+
|
86
143
|
- Rails 4.2.0.rc3 compatibility
|
87
144
|
|
88
145
|
## [2.0.0] - 2014-06-26
|
146
|
+
|
89
147
|
### Removed
|
148
|
+
|
90
149
|
- Override of `dup`
|
91
150
|
- References to `dup`
|
151
|
+
|
92
152
|
### Fixed
|
153
|
+
|
93
154
|
- Open-ended dependency warning
|
94
155
|
|
95
156
|
## [1.7.0] - 2014-06-25
|
157
|
+
|
96
158
|
### Deprecated
|
159
|
+
|
97
160
|
- Deprecated `dup` in favor of `deep_clone`
|
98
161
|
|
99
162
|
## [1.6.1] - 2014-04-16
|
163
|
+
|
100
164
|
### Changed
|
165
|
+
|
101
166
|
- Switched test suite to minitest
|
102
167
|
- Update travis.yml with rails 4.1
|
168
|
+
|
103
169
|
### Fixed
|
170
|
+
|
104
171
|
- Rails 4.1 compatibility
|
105
172
|
|
106
173
|
## [1.6.0] - 2013-11-02
|
174
|
+
|
107
175
|
### Added
|
176
|
+
|
108
177
|
- `:only` option for whitelisting attributes
|
109
178
|
- MIT license
|
110
179
|
|
111
180
|
## [1.5.5] - 2013-08-28
|
181
|
+
|
112
182
|
### Fixed
|
183
|
+
|
113
184
|
- Fix activerecord gem dependency
|
114
185
|
|
115
186
|
## [1.5.4] - 2013-08-12
|
187
|
+
|
116
188
|
### Removed
|
189
|
+
|
117
190
|
- Rails 3.0 support, as it was broken anyway
|
191
|
+
|
118
192
|
### Changed
|
193
|
+
|
119
194
|
- Update travis.yml with rails 4.0
|
195
|
+
|
120
196
|
### Fixed
|
197
|
+
|
121
198
|
- Appraisals should load the correct major version of rails
|
122
199
|
- Exclude unsupported builds in Travis
|
123
200
|
|
124
201
|
## [1.5.3] - 2013-06-18
|
202
|
+
|
125
203
|
### Fixed
|
204
|
+
|
126
205
|
- Fix `initialize_dup` error
|
127
206
|
|
128
207
|
## [1.5.2] - 2013-06-10
|
208
|
+
|
129
209
|
### Fixed
|
210
|
+
|
130
211
|
- Properly support has_many through associations
|
131
212
|
- Fix reverse association lookup for self-referential models
|
132
213
|
- Travis.ci status image
|
133
214
|
|
134
215
|
## [1.5.1] - 2013-03-06
|
216
|
+
|
135
217
|
### Fixed
|
218
|
+
|
136
219
|
- Ruby 2.0 compatibility
|
137
220
|
|
138
221
|
## [1.5.0] - 2013-02-27
|
222
|
+
|
139
223
|
### Added
|
224
|
+
|
140
225
|
- `:validate` option to disable validations when saving a cloned object
|
226
|
+
|
141
227
|
### Fixed
|
228
|
+
|
142
229
|
- Depend on activerecord instead of rails
|
143
230
|
|
144
231
|
## [1.4.1] - 2012-07-23
|
232
|
+
|
145
233
|
### Fixed
|
234
|
+
|
146
235
|
- Don't save HABTM associations on clone
|
147
236
|
|
148
237
|
## [1.4.0] - 2012-04-02
|
238
|
+
|
149
239
|
### Added
|
240
|
+
|
150
241
|
- Possibility to add a optional block
|
242
|
+
|
151
243
|
### Fixed
|
244
|
+
|
152
245
|
- Ruby 1.8.7 compatibility for rails 3.1
|
153
246
|
|
154
247
|
## [1.3.1] - 2012-01-26
|
248
|
+
|
155
249
|
### Fixed
|
250
|
+
|
156
251
|
- Rails 3.2 compatibility
|
157
252
|
|
158
253
|
## [1.2.4] - 2011-06-15
|
254
|
+
|
159
255
|
### Changed
|
256
|
+
|
160
257
|
- Raise an exception when the reverse association is missing
|
258
|
+
|
161
259
|
### Fixed
|
260
|
+
|
162
261
|
- Reset column value when cloning associations
|
163
262
|
|
164
263
|
## [1.2.3] - 2011-02-27
|
264
|
+
|
165
265
|
### Changed
|
266
|
+
|
166
267
|
- Find and set the reverse association when cloning associations
|
167
268
|
|
168
269
|
## [1.2.2] - 2011-02-21
|
270
|
+
|
169
271
|
### Fixed
|
272
|
+
|
170
273
|
- Use association reflection for fetching the primary key name
|
171
274
|
|
172
275
|
## [1.2.1] - 2011-02-07
|
276
|
+
|
173
277
|
### Fixed
|
278
|
+
|
174
279
|
- Cloning for polymorphic associations
|
175
280
|
|
176
281
|
## [1.2.0] - 2010-10-20
|
282
|
+
|
177
283
|
### Added
|
284
|
+
|
178
285
|
- `:except` option for excluding attributes
|
286
|
+
|
179
287
|
### Fixed
|
288
|
+
|
180
289
|
- Set foreign keys properly
|
181
290
|
|
182
291
|
## 1.0.0 - 2010-10-18
|
292
|
+
|
183
293
|
### Fixed
|
294
|
+
|
184
295
|
- Convert existing code to a gem
|
185
296
|
|
186
|
-
[
|
297
|
+
[unreleased]: https://github.com/moiristo/deep_cloneable/compare/v3.1.0...HEAD
|
298
|
+
[3.1.0]: https://github.com/moiristo/deep_cloneable/compare/v3.0.0...v3.1.0
|
187
299
|
[3.0.0]: https://github.com/moiristo/deep_cloneable/compare/v2.4.0...v3.0.0
|
188
300
|
[2.4.0]: https://github.com/moiristo/deep_cloneable/compare/v2.3.2...v2.4.0
|
189
301
|
[2.3.2]: https://github.com/moiristo/deep_cloneable/compare/v2.3.1...v2.3.2
|
data/Gemfile
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'http://rubygems.org'
|
2
4
|
|
3
5
|
gem 'activerecord', '>= 3.1.0', '< 7'
|
4
|
-
gem '
|
5
|
-
gem '
|
6
|
-
gem 'rack', '~> 1.6', :group => :test
|
7
|
-
gem 'rake', '~> 10.4', :group => :test
|
6
|
+
gem 'bundler', '~> 1.17.3', :group => :test
|
7
|
+
gem 'rake', '~> 12.3', :group => :test
|
8
8
|
|
9
9
|
gem 'appraisal', :group => :test
|
10
|
-
gem 'jeweler', :group => :test
|
11
10
|
gem 'minitest', :group => :test
|
12
|
-
gem '
|
13
|
-
gem 'rdoc', '>= 2.4.2', '< 6', :group => :test
|
14
|
-
gem 'sqlite3', :group => :test
|
11
|
+
gem 'sqlite3', '~> 1.3.13', :group => :test
|
data/Gemfile.lock
CHANGED
@@ -12,59 +12,16 @@ GEM
|
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
14
14
|
tzinfo (~> 1.1)
|
15
|
-
addressable (2.4.0)
|
16
15
|
appraisal (2.2.0)
|
17
16
|
bundler
|
18
17
|
rake
|
19
18
|
thor (>= 0.14.0)
|
20
19
|
arel (9.0.0)
|
21
|
-
builder (3.2.3)
|
22
20
|
concurrent-ruby (1.0.5)
|
23
|
-
descendants_tracker (0.0.4)
|
24
|
-
thread_safe (~> 0.3, >= 0.3.1)
|
25
|
-
faraday (0.9.2)
|
26
|
-
multipart-post (>= 1.2, < 3)
|
27
|
-
git (1.2.9.1)
|
28
|
-
github_api (0.16.0)
|
29
|
-
addressable (~> 2.4.0)
|
30
|
-
descendants_tracker (~> 0.0.4)
|
31
|
-
faraday (~> 0.8, < 0.10)
|
32
|
-
hashie (>= 3.4)
|
33
|
-
mime-types (>= 1.16, < 3.0)
|
34
|
-
oauth2 (~> 1.0)
|
35
|
-
hashie (3.5.7)
|
36
|
-
highline (1.6.21)
|
37
21
|
i18n (1.0.0)
|
38
22
|
concurrent-ruby (~> 1.0)
|
39
|
-
jeweler (2.3.9)
|
40
|
-
builder
|
41
|
-
bundler
|
42
|
-
git (>= 1.2.5)
|
43
|
-
github_api (~> 0.16.0)
|
44
|
-
highline (>= 1.6.15)
|
45
|
-
nokogiri (>= 1.5.10)
|
46
|
-
psych
|
47
|
-
rake
|
48
|
-
rdoc
|
49
|
-
semver2
|
50
|
-
jwt (1.5.6)
|
51
|
-
mime-types (2.99.3)
|
52
23
|
minitest (5.11.3)
|
53
|
-
|
54
|
-
multi_xml (0.6.0)
|
55
|
-
multipart-post (2.0.0)
|
56
|
-
nokogiri (1.5.11)
|
57
|
-
oauth2 (1.4.0)
|
58
|
-
faraday (>= 0.8, < 0.13)
|
59
|
-
jwt (~> 1.0)
|
60
|
-
multi_json (~> 1.3)
|
61
|
-
multi_xml (~> 0.5)
|
62
|
-
rack (>= 1.2, < 3)
|
63
|
-
psych (3.0.2)
|
64
|
-
rack (1.6.9)
|
65
|
-
rake (10.5.0)
|
66
|
-
rdoc (5.1.0)
|
67
|
-
semver2 (3.4.2)
|
24
|
+
rake (12.3.3)
|
68
25
|
sqlite3 (1.3.13)
|
69
26
|
thor (0.20.0)
|
70
27
|
thread_safe (0.3.6)
|
@@ -77,15 +34,10 @@ PLATFORMS
|
|
77
34
|
DEPENDENCIES
|
78
35
|
activerecord (>= 3.1.0, < 7)
|
79
36
|
appraisal
|
80
|
-
|
81
|
-
highline (~> 1.6.0)
|
82
|
-
jeweler
|
37
|
+
bundler (~> 1.17.3)
|
83
38
|
minitest
|
84
|
-
|
85
|
-
|
86
|
-
rake (~> 10.4)
|
87
|
-
rdoc (>= 2.4.2, < 6)
|
88
|
-
sqlite3
|
39
|
+
rake (~> 12.3)
|
40
|
+
sqlite3 (~> 1.3.13)
|
89
41
|
|
90
42
|
BUNDLED WITH
|
91
43
|
1.17.3
|