app/models/task.rb
def right_time
    scheduled_time = self.time_of_day.seconds_since_midnight
    now_time = Time.now.seconds_since_midnight
    seconds_past_scheduled = now_time - scheduled_time
    if seconds_past_scheduled > 0 && seconds_past_scheduled < location.department.department_config.task_leniency.minutes   #needs doing if not done within an hour
      return true
    elsif self.kind == "Hourly" #not exactly valid interpretation, since hourly tasks shouldn't have a time_of_day; to prevent nil value errors
      return true
    else
      return false
    end
  end
#returns boolean if now is after scheduled time for task today; does not respect designated days for weekly tasks
returns boolean if now is after scheduled time for task today; does not respect designated days for weekly tasks
returns boolean if now is after scheduled time for task today ; does not respect designated days for weekly tasks
def right_time
    scheduled_time = self.time_of_day.seconds_since_midnight
    now_time = Time.now.seconds_since_midnight
    seconds_past_scheduled = now_time - scheduled_time
    if seconds_past_scheduled > 0 && seconds_past_scheduled < location.department.department_config.task_leniency.minutes   
      return true
    elsif self.kind == "Hourly" 
      return true
    else
      return false
    end
  end
def right_time scheduled_time = self . time_of_day . seconds_since_midnight now_time = Time . now . seconds_since_midnight seconds_past_scheduled = now_time - scheduled_time if seconds_past_scheduled > 0 && seconds_past_scheduled < location . department . department_config . task_leniency . minutes return true elsif self . kind == "Hourly" return true else return false end end
returns boolean if now is after scheduled time for task today; does not respect designated days for weekly tasks
returns boolean if now is after scheduled time for task today ; does not respect designated days for weekly tasks
#needs doing if not done within an hour #not exactly valid interpretation, since hourly tasks shouldn't have a time_of_day; to prevent nil value errors