+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
require "arvados/keep"
class Arvados::V1::CollectionsController < ApplicationController
def untrash
if @object.is_trashed
- @object.update_attributes!(trash_at: nil)
+ @object.trash_at = nil
+
+ if params[:ensure_unique_name]
+ @object.save_with_unique_name!
+ else
+ @object.save!
+ end
else
raise InvalidStateTransitionError
end