app/models/task.rb
def done
    @last_completion = ShiftsTask.find_all_by_task_id(self.id).select{|st| st.task_id == self.id}.last #use find method
    if @last_completion
      if (self.kind == "Hourly") && completed_this_hour?(@last_completion) && completed_today?(@last_completion)
        return true
      elsif (self.kind == "Daily") && completed_today?(@last_completion)
        return true
      elsif (self.kind == "Weekly") && completed_this_week?(@last_completion)
        return true
      else
        return false
      end
    else
      return false
    end
  end
#done shifts are crossed out in their locations
done shifts are crossed out in their locations
done shifts are crossed out in their locations
def done
    @last_completion = ShiftsTask.find_all_by_task_id(self.id).select{|st| st.task_id == self.id}.last 
    if @last_completion
      if (self.kind == "Hourly") && completed_this_hour?(@last_completion) && completed_today?(@last_completion)
        return true
      elsif (self.kind == "Daily") && completed_today?(@last_completion)
        return true
      elsif (self.kind == "Weekly") && completed_this_week?(@last_completion)
        return true
      else
        return false
      end
    else
      return false
    end
  end
def done @last_completion = ShiftsTask . find_all_by_task_id ( self . id ) . select { | st | st . task_id == self . id } . last if @last_completion if ( self . kind == "Hourly" ) && completed_this_hour? ( @last_completion ) && completed_today? ( @last_completion ) return true elsif ( self . kind == "Daily" ) && completed_today? ( @last_completion ) return true elsif ( self . kind == "Weekly" ) && completed_this_week? ( @last_completion ) return true else return false end else return false end end
done shifts are crossed out in their locations
done shifts are crossed out in their locations
#use find method