app/models/naf/machine_runner_invocation.rb in naf-1.1.4 vs app/models/naf/machine_runner_invocation.rb in naf-2.0.0

- old
+ new

@@ -6,11 +6,12 @@ :dead_at, :wind_down_at, :commit_information, :branch_name, :repository_name, - :deployment_tag + :deployment_tag, + :uuid #--------------------- # *** Associations *** #+++++++++++++++++++++ @@ -45,9 +46,16 @@ #{::Naf.schema_name}.machine_runner_invocations.machine_runner_id = mri2.machine_runner_id" ) else return where({}) end + end + + def self.recently_marked_dead(time) + where(" + #{::Naf.schema_name}.machine_runner_invocations.dead_at IS NOT NULL AND + #{::Naf.schema_name}.machine_runner_invocations.dead_at > ?", Time.zone.now - time + ) end #------------------------- # *** Instance Methods *** #+++++++++++++++++++++++++