mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
fixing scheduling bug
This commit is contained in:
parent
df609c8df8
commit
f2141fb6dc
3 changed files with 4 additions and 3 deletions
|
|
@ -146,7 +146,8 @@ class RecipientSchedule < ApplicationRecord
|
|||
|
||||
def self.create_for_recipient(recipient_or_recipient_id, schedule, next_attempt_at=nil)
|
||||
if next_attempt_at.nil?
|
||||
next_attempt_at = next_valid_attempt_time
|
||||
next_attempt_at = Time.at(schedule.start_date.to_time.to_i + (60 * schedule.time))
|
||||
next_attempt_at += 1.day while next_attempt_at.on_weekend?
|
||||
end
|
||||
|
||||
question_ids = schedule.question_list.question_ids.split(/,/)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class CreateSchedules < ActiveRecord::Migration[5.0]
|
|||
t.references :school, foreign_key: true
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.integer :frequency_hours
|
||||
t.integer :frequency_hours, default: 24
|
||||
t.date :start_date
|
||||
t.date :end_date
|
||||
t.boolean :active, default: true
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ ActiveRecord::Schema.define(version: 20170418173141) do
|
|||
t.integer "school_id"
|
||||
t.string "name"
|
||||
t.text "description"
|
||||
t.integer "frequency_hours"
|
||||
t.integer "frequency_hours", default: 24
|
||||
t.date "start_date"
|
||||
t.date "end_date"
|
||||
t.boolean "active", default: true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue