Do not blow up on the 'Manage account' page if the db contains an ssh
[arvados.git] / apps / workbench / app / models / job.rb
index 6fe37431b48f6f991755f66612b93441be829e95..aac6168d22aecac8d37d9afcaee56db844cecdcd 100644 (file)
@@ -1,9 +1,13 @@
 class Job < ArvadosBase
-  def self.goes_in_folders?
+  def self.goes_in_projects?
     true
   end
 
-  def attribute_editable?(attr)
+  def content_summary
+    "#{script} job"
+  end
+
+  def attribute_editable? attr, *args
     false
   end
 
@@ -25,4 +29,8 @@ class Job < ArvadosBase
       x += " submitted #{created_at.strftime('%b %-d')}"
     end
   end
+
+  def cancel
+    arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
+  end
 end