From 66e40806c2f117519c986d2cbedfca50a71d44bd Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 21 Aug 2014 17:10:45 -0400 Subject: [PATCH] 3504: Support copy and moving collections on new apiserver --- apps/workbench/app/controllers/actions_controller.rb | 5 ++++- apps/workbench/app/controllers/projects_controller.rb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb index 265cff456c..fd4ebc4cd4 100644 --- a/apps/workbench/app/controllers/actions_controller.rb +++ b/apps/workbench/app/controllers/actions_controller.rb @@ -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 diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb index d9ec0a6965..43440fe2aa 100644 --- a/apps/workbench/app/controllers/projects_controller.rb +++ b/apps/workbench/app/controllers/projects_controller.rb @@ -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, -- 2.30.2