def rollup_status
      with_lock do
        # We don't need all of the status of the children, just need to see
        # if there is at least one PENDING, PERFORMING, or FAILURE.
        # however, we can't use distinct with order by (from acts_as_nested_set)
        # with postgres or you get the following error:
        #   ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
        stats = children.pluck(:status).uniq

        # Don't mark as pass or fail until all jobs are complete
        return if stats.include?(PENDING) || stats.include?(PERFORMING)
        return fail! if stats.include?(FAILURE)
        success!
      end
    end
def rollup_status
      with_lock do
        # We don't need all of the status of the children, just need to see
        # if there is at least one PENDING, PERFORMING, or FAILURE.
        # however, we can't use distinct with order by (from acts_as_nested_set)
        # with postgres or you get the following error:
        #   ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
        stats = children.pluck(:status).uniq

        # Don't mark as pass or fail until all jobs are complete
        return if stats.include?(PENDING) || stats.include?(PERFORMING)
        return fail! if stats.include?(FAILURE)
        success!
      end
    end
If this is a batch job (has children), check to see if all the children are complete
 @see #fail! when none of the children are in a PENDING nor PERFORMING state but at least one is in a FAILURE state
 @see #success! none of the children are in a PENDING, PERFORMING, nor FAILURE state