Add basic deadline to sections index
This commit is contained in:
parent
782355322e
commit
f4106b9fb6
15 changed files with 175 additions and 1 deletions
21
app/models/extension.rb
Normal file
21
app/models/extension.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue