3859: Cleaned up validate_state_change. Added unit test for job locking.
[arvados.git] / services / api / app / models / arvados_model.rb
index 4ef62c99c7b33445840aefdc470f12f7c73d8e9f..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,19 +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
-
-  # can this class of object go into a project?
-  # default to false, override to true on individual model classes
-  def self.goes_in_projects?
-    false
-  end
-
   protected
 
   def ensure_ownership_path_leads_to_user