Merge branch 'master' into 4878-rerun-job
[arvados.git] / apps / workbench / app / controllers / projects_controller.rb
index a0bf262c960384a58e11d34d5949be5b7dc60a38..df454f72afcf3e24948d67ea00e7f47957a0a720 100644 (file)
@@ -111,7 +111,13 @@ class ProjectsController < ApplicationController
         @removed_uuids << link.uuid
         link.destroy
       end
-      if item.owner_uuid == @object.uuid
+
+      # If this object has the 'expires_at' attribute, then simply mark it
+      # expired.
+      if item.attributes.include?("expires_at")
+        item.update_attributes expires_at: Time.now
+        @removed_uuids << item.uuid
+      elsif item.owner_uuid == @object.uuid
         # Object is owned by this project. Remove it from the project by
         # changing owner to the current user.
         begin