diff --git a/app/models/exercise.rb b/app/models/exercise.rb index fb2608632..3b3b93f09 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -144,7 +144,7 @@ class Exercise < ApplicationRecord pb_time = publish_time en_time = end_time - if end_time <= Time.now && exercise_status != 3 + if en_time.present? && (en_time <= Time.now) && (exercise_status != 3) update_column("exercise_status",3) end else