Class: Logical::Naf::JobStatuses::Terminated

Inherits:
Object
  • Object
show all
Defined in:
app/models/logical/naf/job_statuses/terminated.rb

Class Method Summary collapse

Class Method Details

.all(conditions) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/logical/naf/job_statuses/terminated.rb', line 6

def self.all(conditions)
  <<-SQL
  (
    SELECT
      hj.*, NULL AS "historical_job_id"
    FROM
      "#{::Naf.schema_name}"."historical_jobs" AS hj
    WHERE
      hj.request_to_terminate IS TRUE AND hj.finished_at IS NULL
      #{conditions}
    ORDER BY
      finished_at DESC NULLS LAST
  )
  SQL
end