From 89fbb8bf806dde53fd7cfc761cf3d0719fbebf59 Mon Sep 17 00:00:00 2001 From: Tim Pierce Date: Wed, 21 Jan 2015 15:50:56 -0500 Subject: [PATCH] 5010: remove_items sets the expired_at date if available On objects which support expired_at, remove_items will set that date rather than moving them out of the current project. --- apps/workbench/app/controllers/projects_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/workbench/app/controllers/projects_controller.rb b/apps/workbench/app/controllers/projects_controller.rb index a0bf262c96..df454f72af 100644 --- a/apps/workbench/app/controllers/projects_controller.rb +++ b/apps/workbench/app/controllers/projects_controller.rb @@ -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 -- 2.30.2