Skip to content

Commit

Permalink
Fix error caused if Help Center is already set
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Feb 9, 2024
1 parent 08b5816 commit 167c7dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/data/20240125154727_add_help_center_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class AddHelpCenterSetting < ActiveRecord::Migration[7.1]
def up
setting = Setting.find_or_create_by(name: 'HelpCenter')
setting = Setting.create(name: 'HelpCenter') unless Setting.exists?(name: 'HelpCenter')

SiteSetting.find_or_create_by(setting:, value: '', provider: 'greenlight')
SiteSetting.create(setting:, value: '', provider: 'greenlight') unless SiteSetting.exists?(setting:, value: '', provider: 'greenlight')

Tenant.all.each do |tenant|
SiteSetting.find_or_create_by(setting:, value: '', provider: tenant.name)
Expand Down

0 comments on commit 167c7dc

Please sign in to comment.