Fixed migration on fresh setups.
This commit is contained in:
parent
89e00230f5
commit
68b618359e
2 changed files with 35 additions and 24 deletions
|
@ -15,13 +15,19 @@ class UpdateSetting3 < ActiveRecord::Migration
|
||||||
setting.save
|
setting.save
|
||||||
}
|
}
|
||||||
setting = Setting.find_by(name: 'product_name')
|
setting = Setting.find_by(name: 'product_name')
|
||||||
setting.preferences[:prio] = 1
|
if setting
|
||||||
setting.save
|
setting.preferences[:prio] = 1
|
||||||
|
setting.save
|
||||||
|
end
|
||||||
setting = Setting.find_by(name: 'organization')
|
setting = Setting.find_by(name: 'organization')
|
||||||
setting.preferences[:prio] = 2
|
if setting
|
||||||
setting.save
|
setting.preferences[:prio] = 2
|
||||||
|
setting.save
|
||||||
|
end
|
||||||
setting = Setting.find_by(name: 'product_logo')
|
setting = Setting.find_by(name: 'product_logo')
|
||||||
setting.preferences[:prio] = 3
|
if setting
|
||||||
setting.save
|
setting.preferences[:prio] = 3
|
||||||
|
setting.save
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
41
db/seeds.rb
41
db/seeds.rb
|
@ -48,27 +48,10 @@ Setting.create_if_not_exists(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
preferences: { render: true, session_check: true, prio: 1 },
|
||||||
state: 'Zammad',
|
state: 'Zammad',
|
||||||
frontend: true
|
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(
|
Setting.create_if_not_exists(
|
||||||
title: 'Logo',
|
title: 'Logo',
|
||||||
name: 'product_logo',
|
name: 'product_logo',
|
||||||
|
@ -84,9 +67,29 @@ Setting.create_if_not_exists(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
preferences: { prio: 3 },
|
||||||
state: 'logo.svg',
|
state: 'logo.svg',
|
||||||
frontend: true
|
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(
|
Setting.create_if_not_exists(
|
||||||
title: 'SystemID',
|
title: 'SystemID',
|
||||||
|
@ -686,6 +689,7 @@ Setting.create_if_not_exists(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
preferences: { render: true },
|
||||||
state: 'Ticket#',
|
state: 'Ticket#',
|
||||||
frontend: true
|
frontend: true
|
||||||
)
|
)
|
||||||
|
@ -1115,6 +1119,7 @@ Setting.create_if_not_exists(
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
preferences: { render: true },
|
||||||
state: false,
|
state: false,
|
||||||
frontend: true
|
frontend: true
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue