lib/timescale/job_stats.rb in timescaledb-0.1.4 vs lib/timescale/job_stats.rb in timescaledb-0.1.5
- old
+ new
@@ -1,18 +1,17 @@
module Timescale
- class JobStats < ActiveRecord::Base
+ class JobStat < ActiveRecord::Base
self.table_name = "timescaledb_information.job_stats"
belongs_to :job
- attribute :last_run_duration, :interval
-
scope :success, -> { where(last_run_status: "Success") }
scope :scheduled, -> { where(job_status: "Scheduled") }
scope :resume, -> do
select("sum(total_successes)::int as success,
sum(total_runs)::int as runs,
sum(total_failures)::int as failures")
.to_a.map{|e|e.attributes.transform_keys(&:to_sym) }
end
end
+ JobStats = JobStat
end