X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/454ee2b8f0385c542b6f1165a3baf2820425e1a3..c3872e7a1c817cd39b702f694f70d34f28f7f472:/services/api/lib/trashable.rb diff --git a/services/api/lib/trashable.rb b/services/api/lib/trashable.rb index f7faabc4c2..50611c305d 100644 --- a/services/api/lib/trashable.rb +++ b/services/api/lib/trashable.rb @@ -65,7 +65,7 @@ module Trashable earliest_delete = [ @validation_timestamp, trash_at_was, - ].compact.min + Rails.configuration.Collections.BlobSigningTTL.seconds + ].compact.min + Rails.configuration.Collections.BlobSigningTTL # The previous value of delete_at is also an upper bound on the # longest-lived permission token. For example, if TTL=14, @@ -93,19 +93,19 @@ end module TrashableController def destroy if !@object.is_trashed - @object.update_attributes!(trash_at: db_current_time) + @object.update!(trash_at: db_current_time) end earliest_delete = (@object.trash_at + - Rails.configuration.Collections.BlobSigningTTL.seconds) + Rails.configuration.Collections.BlobSigningTTL) if @object.delete_at > earliest_delete - @object.update_attributes!(delete_at: earliest_delete) + @object.update!(delete_at: earliest_delete) end show end def trash if !@object.is_trashed - @object.update_attributes!(trash_at: db_current_time) + @object.update!(trash_at: db_current_time) end show end