Skip to content

Commit

Permalink
fix(config): Removes disable_account_registration from database (#247)
Browse files Browse the repository at this point in the history
* fix(config): Removes disable_account_registration from database

* fix(config): Saves new config item, adds extra precautionary check
  • Loading branch information
cbaudouinjr authored Jun 18, 2020
1 parent f07ec28 commit 82a7ff4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 82a7ff4

Please sign in to comment.