deep_cloneable_checked 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/deep_cloneable_checked/deep_clone_checked.rb +11 -0
- data/lib/deep_cloneable_checked/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5edd682302405b1850f37d6a36658a9e9bb70c5fc5eeb39daedf87f3e7e4b4ae
|
4
|
+
data.tar.gz: ec9cb175130b846cef0aeb4b7efa2cdb7f38785d097316a846c822a41f88556d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a079c0fe7a450df2220bec1d5dcfb2b6b4ece5b9769a812a6396686b8c4a63e67719ecddcd61ec2868291bb0edf6576efbbe595dd6b7de306185885d4ac83f
|
7
|
+
data.tar.gz: e46add614f128646f9ea67f00270b883a9e20ede7747991be64004c6a8c4daae73026b4ede220b5a445913fd29a39ff079a1d6905a88a4362a588379a398bbd3
|
data/Gemfile.lock
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'set'
|
2
|
+
|
1
3
|
module DeepCloneableChecked
|
2
4
|
module DeepCloneChecked
|
3
5
|
def deep_clone_checked(options)
|
@@ -11,10 +13,19 @@ module DeepCloneableChecked
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def validate_clone_check(options)
|
16
|
+
checked = Set[]
|
17
|
+
|
14
18
|
check_missing = lambda do |klass, includes, excludes|
|
15
19
|
includes = DeepCloneableChecked.options_to_hash(includes)
|
16
20
|
excludes = DeepCloneableChecked.options_to_hash(excludes)
|
17
21
|
# puts "-----------\n klass: #{klass.name}, includes: #{includes.inspect}, excludes: #{excludes.inspect}"
|
22
|
+
|
23
|
+
# If we have already checked this class then we assume we don't
|
24
|
+
# clone it in a different manner. This assumption might not be valid
|
25
|
+
# but assuming otherwise would be complex and YAGNI (hopefully).
|
26
|
+
return nil if checked.include? klass
|
27
|
+
|
28
|
+
checked << klass
|
18
29
|
associations = klass.reflections
|
19
30
|
|
20
31
|
associations.map do |association_name, reflection|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deep_cloneable_checked
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaori Kohama
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-09-
|
12
|
+
date: 2022-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: deep_cloneable
|