Add basic deadline to sections index

This commit is contained in:
Charlotte Van Petegem 2025-05-25 21:54:34 +02:00
parent 782355322e
commit f4106b9fb6
Signed by: chvp
SSH key fingerprint: SHA256:s9rb8jBVfdahqWHuBAcHCBP1wmj4eYQXZfqgz4H3E9E
15 changed files with 175 additions and 1 deletions

21
app/models/extension.rb Normal file
View file

@ -0,0 +1,21 @@
# == Schema Information
#
# Table name: extensions
#
# id :integer not null, primary key
# confirmed :boolean
# reason :text
# created_at :datetime not null
# updated_at :datetime not null
#
class Extension < ApplicationRecord
def affect_deadline(deadline)
return deadline unless confirmed
deadline + 6.weeks
end
def confirm!
update!(confirmed: true)
end
end