activerecord_cloneable 0.3.16 → 0.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/activerecord_cloneable.gemspec +1 -1
- data/lib/active_record/cloneable.rb +0 -3
- 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: 63e818d1b83b06f055dfb150080cd5a2bc6773a1
|
4
|
+
data.tar.gz: 3d22fc913a7b3e715c9d94695eda9d44148b7d20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e79aa778f08b7319d346b27b7fa9bb2094cabce77afaf9ca5afc88860955dfc7b1ba3182640b257355c94a2e50dcce35be453f1c1d7cafb1172d600598bb542c
|
7
|
+
data.tar.gz: ec9e33cf250bd3ca011cf6a3661e3880e9093ae5e189568da48f26d8cf670a4b2d294864bd48d01ec7c0f98d426cf1ecfb65a76b050afc66bac02e0532e354ea
|
@@ -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.17'
|
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'
|
@@ -42,7 +42,6 @@ module ActiveRecord::Cloneable
|
|
42
42
|
def clone_belongs_to_relations( relations, cloned_record, args )
|
43
43
|
return if relations.nil?
|
44
44
|
relations.each do |parent_relation|
|
45
|
-
puts "Cloning (belongs_to) #{parent_relation.name} with #{args}"
|
46
45
|
obj = send( parent_relation.name )
|
47
46
|
next if obj.nil?
|
48
47
|
next if args[:skipped_children].include?( obj )
|
@@ -129,7 +128,6 @@ module ActiveRecord::Cloneable
|
|
129
128
|
# child_args[:attributes][child_relation.primary_key_name.to_sym] = nil
|
130
129
|
#end
|
131
130
|
begin
|
132
|
-
puts "Cloning #{child_relation.name} with #{child_args}"
|
133
131
|
cloned_child_record = child_record.clone_record( child_args )
|
134
132
|
cloned_record.send( child_relation.name ) << cloned_child_record
|
135
133
|
rescue NoMethodError
|
@@ -152,7 +150,6 @@ module ActiveRecord::Cloneable
|
|
152
150
|
stack: args[:stack] + [ child_relation.name ] ,
|
153
151
|
skipped_child_relations: args[:skipped_child_relations].find_all{ |x| x.is_a?( Hash ) && x[child_relation.name.to_sym] }.map{ |x| x.values }.flatten }
|
154
152
|
begin
|
155
|
-
puts "Cloning #{child_relation.name} with #{child_args}"
|
156
153
|
cloned_child_record = kid.clone_record( child_args )
|
157
154
|
cloned_record.send( "#{child_relation.name}=", cloned_child_record )
|
158
155
|
rescue NoMethodError
|