activerecord_cloneable 0.3.11 → 0.3.12
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/activerecord_cloneable.gemspec +1 -1
- data/lib/active_record/cloneable.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 225c94ff6925bb2615796876179e19866b22c90c
|
4
|
+
data.tar.gz: bb0f966e2b6d0fa0d40c21d1e7d8028b6a471fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa5b9843e48aa1a85c8294f9fefcf9f9555f88c705ba5e6a5c05e11edcb1dcc2c1d4ee9345a59641faf8ff3ed749dedda8784775519cca3b4bcafddd4eeb5997
|
7
|
+
data.tar.gz: c7341b1e71d5baff14fff8e0defcc6bba5d55ad0675c11675003e4396dc65aae8e1f56683de9c83de818996dac92d02f9e16b5f90cbe74e40a2275b3f6322fbc
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'activerecord_cloneable'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.12'
|
4
4
|
s.summary = "A library to help clone active records - that is, generate active new record objects with the data copied from an existing record."
|
5
5
|
s.authors = ["Adam Palmblad"]
|
6
6
|
s.email = 'apalmblad@gmail.com'
|
@@ -46,12 +46,13 @@ module ActiveRecord::Cloneable
|
|
46
46
|
obj = send( parent_relation.name )
|
47
47
|
next if obj.nil?
|
48
48
|
next if args[:skipped_children].include?( obj )
|
49
|
+
args[:skipped_children] += [ obj ]
|
49
50
|
if args[:shared_parent_relations].include?( parent_relation.name.to_sym )
|
50
51
|
cloned_record.send( "#{parent_relation.name}=", obj )
|
51
52
|
elsif !args[:cloned_parents].include?( obj )
|
52
53
|
# We don't know what the parent calls this child.
|
53
54
|
begin
|
54
|
-
rec = obj.clone_record( skipped_children: args[:skipped_children] + [self
|
55
|
+
rec = obj.clone_record( skipped_children: args[:skipped_children] + [self],
|
55
56
|
cloned_parents: args[:cloned_parents] + [self],
|
56
57
|
stack: args[:stack] + [ parent_relation.name ],
|
57
58
|
skipped_child_relations: find_applicable_clone_args( parent_relation.name, args[:skipped_child_relations] ),
|