3899: Set :state in pipeline_instance_helper.rb and remove Job::state.
[arvados.git] / apps / workbench / app / models / job.rb
index f933c07701fdcf781c7c19559b6bb023bf7667be..977eef91bf278ac5e9a528e935262dce478e4fa5 100644 (file)
@@ -46,29 +46,6 @@ class Job < ArvadosBase
     arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
   end
 
-  # The 'job' parameter can be either a Job model object, or a hash containing
-  # the same fields as a Job object (such as the :job entry of a pipeline
-  # component).
-  def self.state job
-    # This has a valid state method on it so call that
-    if job.respond_to? :state and job.state
-      return job.state
-    end
-
-    # Figure out the state based on the other fields.
-    if job[:cancelled_at]
-      "Cancelled"
-    elsif job[:success] == false
-      "Failed"
-    elsif job[:success] == true
-      "Complete"
-    elsif job[:running] == true
-      "Running"
-    else
-      "Queued"
-    end
-  end
-
   def textile_attributes
     [ 'description' ]
   end