3504: Support copy and moving collections on new apiserver
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 21 Aug 2014 21:10:45 +0000 (17:10 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 22 Aug 2014 12:44:09 +0000 (08:44 -0400)
apps/workbench/app/controllers/actions_controller.rb
apps/workbench/app/controllers/projects_controller.rb

index 265cff456ce760a1c850582def2bd709d3e750fb..fd4ebc4cd4a890bad064f415f5e7e839f02cd9a7 100644 (file)
@@ -48,7 +48,7 @@ class ActionsController < ApplicationController
       uniq.
       each do |resource_class|
       resource_class.filter([['uuid','in',uuids_to_add]]).each do |src|
-        if resource_class == Collection
+        if resource_class == Collection and not Collection.attribute_info.include?(:name)
           dst = Link.new(owner_uuid: @object.uuid,
                          tail_uuid: @object.uuid,
                          head_uuid: src.uuid,
@@ -65,6 +65,9 @@ class ActionsController < ApplicationController
                 dst.name = "Copy of unnamed #{dst.class_for_display.downcase}"
               end
             end
+            if resource_class == Collection
+              dst.manifest_text = Collection.select([:manifest_text]).where(uuid: src.uuid).first.manifest_text
+            end
           when :move
             dst = src
           else
index d9ec0a6965323eb29d10b4b2d695218eaabfdbfe..43440fe2aa96506e35f305821007f71526fbc8dc 100644 (file)
@@ -86,7 +86,7 @@ class ProjectsController < ApplicationController
       uniq.
       each do |resource_class|
       resource_class.filter([['uuid','in',uuids_to_add]]).each do |dst|
-        if resource_class == Collection
+        if resource_class == Collection and not Collection.attribute_info.include?(:name)
           dst = Link.new(owner_uuid: target_uuid,
                          tail_uuid: target_uuid,
                          head_uuid: dst.uuid,