2762: Move destroy_permission_links method to HasUuid.
authorTom Clegg <tom@curoverse.com>
Wed, 14 May 2014 18:04:20 +0000 (14:04 -0400)
committerTom Clegg <tom@curoverse.com>
Wed, 14 May 2014 18:04:20 +0000 (14:04 -0400)
services/api/app/models/arvados_model.rb
services/api/lib/has_uuid.rb

index 79237b80e39b481d5ff72eb797a67b6534814223..4a717c4658415c6e764ffd4c09615044db8f6398 100644 (file)
@@ -237,11 +237,6 @@ class ArvadosModel < ActiveRecord::Base
     return true
   end
 
-  def destroy_permission_links
-    Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
-                      'permission', uuid, uuid])
-  end
-
   def ensure_permission_to_destroy
     raise PermissionDeniedError unless permission_to_destroy
   end
index 21369d199eed2ec550a22be7133fa9550a24520a..d9c819889f543f1acbc3ccfafc5a370137efb970 100644 (file)
@@ -31,4 +31,9 @@ module HasUuid
     return true if uuid and current_user and current_user.is_admin
     self.uuid = self.class.generate_uuid
   end
+
+  def destroy_permission_links
+    Link.destroy_all(['link_class=? and (head_uuid=? or tail_uuid=?)',
+                      'permission', uuid, uuid])
+  end
 end