Class: Upgrade::PruneOrphanedProblems

Inherits:
IterationJob
  • Object
show all
Defined in:
app/jobs/upgrade/prune_orphaned_problems.rb

Instance Method Summary collapse

Instance Method Details

#build_enumerator(cursor:) ⇒ Object



4
5
6
# File 'app/jobs/upgrade/prune_orphaned_problems.rb', line 4

def build_enumerator(cursor:)
  enumerator_builder.active_record_on_records(Problem.all, cursor: cursor)
end

#each_iteration(problem) ⇒ Object



8
9
10
# File 'app/jobs/upgrade/prune_orphaned_problems.rb', line 8

def each_iteration(problem)
  problem.destroy if problem.problematic.nil?
end