3114: When current user, show root/home project rather than user attributes when...
[arvados.git] / apps / workbench / app / controllers / actions_controller.rb
index 9f2cfb09f3da31ecb6953b5e5a3e915b212d757f..265cff456ce760a1c850582def2bd709d3e750fb 100644 (file)
@@ -11,13 +11,15 @@ class ActionsController < ApplicationController
   end
 
   def show
-    @object = model_class.find(params[:uuid])
+    @object = model_class.andand.find(params[:uuid])
     if @object.is_a? Link and
         @object.link_class == 'name' and
         ArvadosBase::resource_class_for_uuid(@object.head_uuid) == Collection
       redirect_to collection_path(id: @object.uuid)
-    else
+    elsif @object
       redirect_to @object
+    else
+      raise ActiveRecord::RecordNotFound
     end
   end
 
@@ -40,6 +42,7 @@ class ActionsController < ApplicationController
 
   def move_or_copy action
     uuids_to_add = params["selection"]
+    uuids_to_add = [ uuids_to_add ] unless uuids_to_add.is_a? Array
     uuids_to_add.
       collect { |x| ArvadosBase::resource_class_for_uuid(x) }.
       uniq.