Fix updateConfigTheme method.

No Issue
- Fix exception being thrown when updateConfigTheme called before
  settingsCache fully populated.
- Remove unnecessary check in a conditional in the migration command
  builder.
This commit is contained in:
Jason Williams 2014-11-20 14:50:01 +00:00
parent 0c38a839b0
commit b31fec6e2f
2 changed files with 5 additions and 5 deletions

View File

@ -37,10 +37,10 @@ var _ = require('lodash'),
updateConfigTheme = function () {
config.set({
theme: {
title: settingsCache.title.value || '',
description: settingsCache.description.value || '',
logo: settingsCache.logo.value || '',
cover: settingsCache.cover.value || ''
title: (settingsCache.title && settingsCache.title.value) || '',
description: (settingsCache.description && settingsCache.description.value) || '',
logo: (settingsCache.logo && settingsCache.logo.value) || '',
cover: (settingsCache.cover && settingsCache.cover.value) || ''
}
});
};

View File

@ -48,7 +48,7 @@ addColumnCommands = function addColumnCommands(table, columns) {
modifyUniqueCommands = function modifyUniqueCommands(table, indexes) {
var columnKeys = _.keys(schema[table]);
return _.map(columnKeys, function (column) {
if (schema[table][column].unique && schema[table][column].unique === true) {
if (schema[table][column].unique === true) {
if (!_.contains(indexes, table + '_' + column + '_unique')) {
return function () {
logInfo('Adding unique on: ' + table + '.' + column);