From 82a7ff4484442e14926347fe07145d4881ace009 Mon Sep 17 00:00:00 2001 From: "Chris Baudouin, Jr" Date: Thu, 18 Jun 2020 08:58:35 -0400 Subject: [PATCH] fix(config): Removes disable_account_registration from database (#247) * fix(config): Removes disable_account_registration from database * fix(config): Saves new config item, adds extra precautionary check --- ...lete_disable_account_registration_from_settings.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb diff --git a/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb b/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb new file mode 100644 index 000000000..e92b25783 --- /dev/null +++ b/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb @@ -0,0 +1,11 @@ +class DeleteDisableAccountRegistrationFromSettings < ActiveRecord::Migration[5.2] + def self.up + return unless HackathonConfig.find_by(var: 'disable_account_registration').present? + HackathonConfig.find_by(var: 'disable_account_registration').destroy + end + + def self.down + return unless HackathonConfig.find_by(var: 'disable_account_registration').nil? + HackathonConfig.create(var: 'disable_account_registration', value: false).save + end +end