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