Class: Logical::Naf::JobStatuses::Finished

Inherits:
Object
  • Object
show all
Defined in:
app/models/logical/naf/job_statuses/finished.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
21
# File 'app/models/logical/naf/job_statuses/finished.rb', line 6

def self.all(conditions)
  <<-SQL
    (
      SELECT
        j.*, null AS "historical_job_id"
      FROM
        "#{::Naf.schema_name}"."historical_jobs" AS j
      WHERE
        (j.finished_at IS NOT NULL OR
         j.request_to_terminate = true)
        #{conditions}
      ORDER BY
        finished_at DESC NULLS LAST
    )
  SQL
end