projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
20300: Change deprecated update_attributes to update.
[arvados.git]
/
services
/
api
/
lib
/
trashable.rb
diff --git
a/services/api/lib/trashable.rb
b/services/api/lib/trashable.rb
index 96879629646b7e413e3c1e6c3e2110d7de0d7173..50611c305ded5d1d166914b1066f6d348a2af51b 100644
(file)
--- a/
services/api/lib/trashable.rb
+++ b/
services/api/lib/trashable.rb
@@
-50,7
+50,7
@@
module Trashable
if trash_at.nil?
self.delete_at = nil
else
if trash_at.nil?
self.delete_at = nil
else
- self.delete_at = trash_at + Rails.configuration.
default_trash_l
ifetime.seconds
+ self.delete_at = trash_at + Rails.configuration.
Collections.DefaultTrashL
ifetime.seconds
end
elsif !trash_at || !delete_at || trash_at > delete_at
# Not trash, or bogus arguments? Just validate in
end
elsif !trash_at || !delete_at || trash_at > delete_at
# Not trash, or bogus arguments? Just validate in
@@
-65,7
+65,7
@@
module Trashable
earliest_delete = [
@validation_timestamp,
trash_at_was,
earliest_delete = [
@validation_timestamp,
trash_at_was,
- ].compact.min + Rails.configuration.
blob_signature_ttl.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,
# 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
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 +
end
earliest_delete = (@object.trash_at +
- Rails.configuration.
blob_signature_ttl.seconds
)
+ Rails.configuration.
Collections.BlobSigningTTL
)
if @object.delete_at > earliest_delete
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
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
end
show
end