mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Couldn't migrate database from nothing due to I18n
Since I18n has a DB backend now, I've introduced a helper we can use to skip overrides in certain situations. Otherwise migration from empty databases was broken.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class AddStaffCategory < ActiveRecord::Migration
|
||||
def up
|
||||
unless Rails.env.test?
|
||||
return if Rails.env.test?
|
||||
|
||||
I18n.backend.overrides_disabled do
|
||||
result = Category.exec_sql "SELECT 1 FROM site_settings where name = 'staff_category_id'"
|
||||
if result.count == 0
|
||||
description = I18n.t('staff_category_description')
|
||||
|
||||
Reference in New Issue
Block a user