lib/copy_move/model.rb in radiant-copy_move-extension-2.4.8 vs lib/copy_move/model.rb in radiant-copy_move-extension-2.4.9
- old
+ new
@@ -26,9 +26,17 @@
self.parts.each do |part|
new_page.parts << part.clone
end
new_page.send :add_to_list_bottom if defined?(Reorder)
new_page.status_id = status.blank? ? new_page.status_id : status
+ if self.respond_to?(:page_attachments) && Radiant::Config["copy_move.copy_page_attachments"]
+ self.page_attachments.each do |att|
+ new_page.page_attachments.build(:asset_id => att.asset_id, :position => att.position)
+ end
+ end
+ if self.respond_to?(:related_page_ids) && Radiant::Config["copy_move.copy_page_relations"]
+ new_page.related_page_ids = self.related_page_ids
+ end
new_page.save!
end
end
def copy_with_children_to(parent, status = nil)