lib/acidic_job/run.rb in acidic_job-1.0.0.pre24 vs lib/acidic_job/run.rb in acidic_job-1.0.0.pre25
- old
+ new
@@ -29,10 +29,12 @@
validates :job_class, presence: true
scope :staged, -> { where(staged: true) }
scope :unstaged, -> { where(staged: false) }
scope :finished, -> { where(recovery_point: FINISHED_RECOVERY_POINT) }
- scope :running, -> { where.not(recovery_point: FINISHED_RECOVERY_POINT) }
+ scope :outstanding, lambda {
+ where.not(recovery_point: FINISHED_RECOVERY_POINT).or(where(recovery_point: [nil, ""]))
+ }
with_options unless: :staged? do
validates :last_run_at, presence: true
validates :recovery_point, presence: true
validates :workflow, presence: true