3859: Cleaned up validate_state_change. Added unit test for job locking.
[arvados.git] / services / api / app / models / arvados_model.rb
index 1138bd2b9b4f8412336e3c9f41dd23355dbf460c..2a98591a36ee10bae8826ff492840c7544f7a40f 100644 (file)
@@ -42,6 +42,13 @@ class ArvadosModel < ActiveRecord::Base
     end
   end
 
+  class ConflictError < StandardError
+    def http_status
+      409
+    end
+  end
+
+
   def self.kind_class(kind)
     kind.match(/^arvados\#(.+)$/)[1].classify.safe_constantize rescue nil
   end
@@ -198,13 +205,6 @@ class ArvadosModel < ActiveRecord::Base
     attributes
   end
 
-  def has_permission? perm_type, target_uuid
-    Link.where(link_class: "permission",
-               name: perm_type,
-               tail_uuid: uuid,
-               head_uuid: target_uuid).any?
-  end
-
   protected
 
   def ensure_ownership_path_leads_to_user