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:
Robin Ward
2015-11-14 16:11:22 -05:00
parent c9c083108a
commit 810a069cfd
7 changed files with 45 additions and 20 deletions

View File

@@ -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')