activerecord_cloneable 0.3.2 → 0.3.3
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 +6 -2
- 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: eadbb5b8c08b54cfb2a056597983026f2ae210ce
|
4
|
+
data.tar.gz: a7ce25f2bf377aa66bd69767e55c25e22717757e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a56d300a32906953b79a350135a64fc5edd7340cc72106c63a81924881a666adfb910be27648ba65c4a42dd5b95ec5772f2144b5f4ccd0c9db9ba41df90e0dc
|
7
|
+
data.tar.gz: 546b3b0a26a76dedbf82a44a90b8f534b79be9000e65d97bbe1fae17f9b85bd9cd1585c09e692e6eee2ee20139b2cc530b01d9379fac13c2924cc440016c34e1
|
@@ -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.3'
|
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'
|
@@ -112,8 +112,12 @@ module ActiveRecord::Cloneable
|
|
112
112
|
kids.each do |child_record|
|
113
113
|
next if args[:skipped_children].include?( child_record )
|
114
114
|
cloned_child_record = kids.build
|
115
|
-
child_args = { cloned_parents: args[:cloned_parents] + [self],
|
116
|
-
|
115
|
+
child_args = { cloned_parents: args[:cloned_parents] + [self],
|
116
|
+
attributes: {},
|
117
|
+
object: cloned_child_record,
|
118
|
+
skipped_parent_relations: find_applicable_clone_args( child_relation.name, args[:skipped_parent_relations] ),
|
119
|
+
shared_parent_relations: find_applicable_clone_args( child_relation.name, args[:shared_parent_relations] ),
|
120
|
+
skipped_child_relations: find_applicable_clone_args( child_relation.name, args[:skipped_child_relations] ) }
|
117
121
|
#if child_relation.macro == :has_many ||child_relation.macro == :has_one
|
118
122
|
# child_args[:attributes][child_relation.primary_key_name.to_sym] = nil
|
119
123
|
#end
|