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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d13258c10306da772b33a465fa76ad5d4fcdefdd9dc991569238e62565844ba6
4
- data.tar.gz: fbb2ab54ded08a430a5363bccec29465f9e958d5f58b56dfceedaf814f426f77
3
+ metadata.gz: 5edd682302405b1850f37d6a36658a9e9bb70c5fc5eeb39daedf87f3e7e4b4ae
4
+ data.tar.gz: ec9cb175130b846cef0aeb4b7efa2cdb7f38785d097316a846c822a41f88556d
5
5
  SHA512:
6
- metadata.gz: 6fa6a9df05c377ac333b4c6405bbd070ea3f06efbd8b89dae49802d32581554728ccfb4b05c29e0d1b968f53e0831d70db07c8bfd6a64ee485ef81a56c56a178
7
- data.tar.gz: 58594c4abfbfbed02fee57db01fd291acb573d36ee3df3257226750c70dc3c039235690601ce65d29611b477299e0a40f6bddd1e7c4928b69f18aa05bbedcdbe
6
+ metadata.gz: d7a079c0fe7a450df2220bec1d5dcfb2b6b4ece5b9769a812a6396686b8c4a63e67719ecddcd61ec2868291bb0edf6576efbbe595dd6b7de306185885d4ac83f
7
+ data.tar.gz: e46add614f128646f9ea67f00270b883a9e20ede7747991be64004c6a8c4daae73026b4ede220b5a445913fd29a39ff079a1d6905a88a4362a588379a398bbd3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- deep_cloneable_checked (1.0.1)
4
+ deep_cloneable_checked (1.1.0)
5
5
  deep_cloneable (~> 3.2.0)
6
6
 
7
7
  GEM
@@ -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|
@@ -1,3 +1,3 @@
1
1
  module DeepCloneableChecked
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
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.1.0
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-08 00:00:00.000000000 Z
12
+ date: 2022-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: deep_cloneable