Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Feb 1, 2024
1 parent 411782c commit 7a6ee67
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
1 change: 1 addition & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,6 @@
config.active_record.dump_schema_after_migration = false

# Enable HSTS in production mode
config.force_ssl = true
config.ssl_options = { hsts: { preload: true, expires: 1.year, subdomains: true } }
end
27 changes: 27 additions & 0 deletions db/data/20240125154727_add_help_center_setting.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

class AddHelpCenterSetting < ActiveRecord::Migration[7.1]
def up
setting = Setting.find_or_create_by(name: 'HelpCenter')
SiteSetting.find_or_create_by(setting:, value: 'Published', provider: 'greenlight')

SiteSetting.find_or_create_by(
setting:,
value: '',
provider: 'greenlight'
)

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

def down
Setting.find_by(name: 'HelpCenter')&.destroy
SiteSetting.find_by(setting: Setting.find_by(name: 'HelpCenter')).destroy
end
end
2 changes: 1 addition & 1 deletion db/data_schema.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DataMigrate::Data.define(version: 20231213203353)
DataMigrate::Data.define(version: 20240125154727)
20 changes: 0 additions & 20 deletions db/migrate/20231218154727_add_help_center_setting.rb

This file was deleted.

0 comments on commit 7a6ee67

Please sign in to comment.