Fixed migration on fresh setups.

This commit is contained in:
Martin Edenhofer 2015-07-12 07:32:50 +02:00
parent 89e00230f5
commit 68b618359e
2 changed files with 35 additions and 24 deletions

View file

@ -15,13 +15,19 @@ class UpdateSetting3 < ActiveRecord::Migration
setting.save
}
setting = Setting.find_by(name: 'product_name')
setting.preferences[:prio] = 1
setting.save
if setting
setting.preferences[:prio] = 1
setting.save
end
setting = Setting.find_by(name: 'organization')
setting.preferences[:prio] = 2
setting.save
if setting
setting.preferences[:prio] = 2
setting.save
end
setting = Setting.find_by(name: 'product_logo')
setting.preferences[:prio] = 3
setting.save
if setting
setting.preferences[:prio] = 3
setting.save
end
end
end

View file

@ -48,27 +48,10 @@ Setting.create_if_not_exists(
},
],
},
preferences: { render: true, session_check: true, prio: 1 },
state: 'Zammad',
frontend: true
)
Setting.create_if_not_exists(
title: 'Organization',
name: 'organization',
area: 'System::Branding',
description: 'Will also be included in emails as an X-Header.',
options: {
form: [
{
display: '',
null: false,
name: 'organization',
tag: 'input',
},
],
},
state: '',
frontend: true
)
Setting.create_if_not_exists(
title: 'Logo',
name: 'product_logo',
@ -84,9 +67,29 @@ Setting.create_if_not_exists(
},
],
},
preferences: { prio: 3 },
state: 'logo.svg',
frontend: true
)
Setting.create_if_not_exists(
title: 'Organization',
name: 'organization',
area: 'System::Branding',
description: 'Will be shown in the app and is included in email headers.',
options: {
form: [
{
display: '',
null: false,
name: 'organization',
tag: 'input',
},
],
},
state: '',
preferences: { prio: 2 },
frontend: true
)
Setting.create_if_not_exists(
title: 'SystemID',
@ -686,6 +689,7 @@ Setting.create_if_not_exists(
},
],
},
preferences: { render: true },
state: 'Ticket#',
frontend: true
)
@ -1115,6 +1119,7 @@ Setting.create_if_not_exists(
},
],
},
preferences: { render: true },
state: false,
frontend: true
)