activerecord_cloneable 0.3.10 → 0.3.11
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 +3 -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: 15db8787833286d526f4e5aed5208004c37e4dc1
|
4
|
+
data.tar.gz: 338c714113747d21e78607d28b02d746decdba0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31a1a0ffaf5bd75a2deca989c48df83e2fede39934f227967d7209daf1a1d80e88c529a3dcd19e10861645f19bf035fbe07d06da64dacfa3c8cb70bee083e14e
|
7
|
+
data.tar.gz: a513b697c49933fc759b37ad14ad98a7f5acf245dd69a827c06347a2f950abd7d3594911108da04d36e499bc5c34590a8f0d6d10ee869c742bdc0b72e6f203ec
|
@@ -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.11'
|
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'
|
@@ -114,12 +114,13 @@ module ActiveRecord::Cloneable
|
|
114
114
|
next if kids.nil?
|
115
115
|
kids.each do |child_record|
|
116
116
|
next if args[:skipped_children].include?( child_record )
|
117
|
+
args[:skipped_children] += [child_record]
|
117
118
|
cloned_child_record = kids.build
|
118
119
|
child_args = { cloned_parents: args[:cloned_parents] + [self],
|
119
120
|
attributes: {},
|
120
121
|
stack: args[:stack] + [ child_relation.name ],
|
121
122
|
object: cloned_child_record,
|
122
|
-
skipped_children: args[:skipped_children]
|
123
|
+
skipped_children: args[:skipped_children],
|
123
124
|
skipped_parent_relations: find_applicable_clone_args( child_relation.name, args[:skipped_parent_relations] ),
|
124
125
|
shared_parent_relations: find_applicable_clone_args( child_relation.name, args[:shared_parent_relations] ),
|
125
126
|
skipped_child_relations: find_applicable_clone_args( child_relation.name, args[:skipped_child_relations] ) }
|
@@ -141,6 +142,7 @@ module ActiveRecord::Cloneable
|
|
141
142
|
kid = send( child_relation.name )
|
142
143
|
next if kid.nil?
|
143
144
|
next if args[:skipped_children].include?( kid )
|
145
|
+
args[:skipped_children] += [kid]
|
144
146
|
cloned_child_record = kid.build
|
145
147
|
child_args = { cloned_parents: args[:cloned_parents] + [self],
|
146
148
|
attributes: {},
|