18691: Go back to old attribute_was method for consistency.
authorTom Clegg <tom@curii.com>
Thu, 17 Mar 2022 18:56:04 +0000 (14:56 -0400)
committerTom Clegg <tom@curii.com>
Thu, 17 Mar 2022 18:56:04 +0000 (14:56 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/api/app/models/arvados_model.rb
services/api/app/models/group.rb

index c71996a3728a60cb6bcef417b4a3998c0d98c2d4..327bf63b5fa057779d6d03d99331b179077611db 100644 (file)
@@ -656,7 +656,7 @@ class ArvadosModel < ApplicationRecord
       # itself. (If we're in the act of unfreezing, we only need
       # :unfreeze permission, which means "what write permission would
       # be if target weren't frozen")
-      unless ((respond_to?(:frozen_by_uuid) && frozen_by_uuid_in_database && !frozen_by_uuid) ?
+      unless ((respond_to?(:frozen_by_uuid) && frozen_by_uuid_was && !frozen_by_uuid) ?
                 current_user.can?(unfreeze: uuid) :
                 current_user.can?(write: uuid))
         logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} without write permission"
index ee8690acb58b15435ba765d88cf0c96439f8e479..d2c332b9b1ff7e3f405c40738ae56b1d9b7737b6 100644 (file)
@@ -248,7 +248,7 @@ class Group < ArvadosModel
   def permission_to_update
     if !super
       return false
-    elsif frozen_by_uuid && frozen_by_uuid_in_database
+    elsif frozen_by_uuid && frozen_by_uuid_was
       errors.add :uuid, "#{uuid} is frozen and cannot be modified"
       return false
     else