Browse Source
* Remove deactivation date from schemes and add scheme deactivation periods table * Update affected logs when a scheme gets deactivated * Update status method * Display availability timeline * Update flash notice messagepull/1008/head
kosiakkatrina
2 years ago
committed by
GitHub
12 changed files with 169 additions and 46 deletions
@ -0,0 +1,3 @@
|
||||
class SchemeDeactivationPeriod < ApplicationRecord |
||||
scope :deactivations_without_reactivation, -> { where(reactivation_date: nil) } |
||||
end |
@ -0,0 +1,10 @@
|
||||
class AddSchemeDeactivations < ActiveRecord::Migration[7.0] |
||||
def change |
||||
create_table :scheme_deactivation_periods do |t| |
||||
t.datetime :deactivation_date |
||||
t.datetime :reactivation_date |
||||
t.belongs_to :scheme |
||||
t.timestamps |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,13 @@
|
||||
class RemoveDeactivationDateFromSchemes < ActiveRecord::Migration[7.0] |
||||
def up |
||||
change_table :schemes, bulk: true do |t| |
||||
t.remove :deactivation_date |
||||
end |
||||
end |
||||
|
||||
def down |
||||
change_table :schemes, bulk: true do |t| |
||||
t.column :deactivation_date, :datetime |
||||
end |
||||
end |
||||
end |
@ -0,0 +1,5 @@
|
||||
FactoryBot.define do |
||||
factory :scheme_deactivation_period do |
||||
reactivation_date { nil } |
||||
end |
||||
end |
Loading…
Reference in new issue