trabajo-afectivo/db/migrate/20170816000001_idoit_support.rb

50 lines
1.2 KiB
Ruby
Raw Normal View History

2017-09-08 08:28:34 +00:00
class IdoitSupport < ActiveRecord::Migration[4.2]
2017-09-06 06:39:02 +00:00
def up
# return if it's a new setup
return if !Setting.find_by(name: 'system_init_done')
Setting.create_if_not_exists(
title: 'i-doit integration',
name: 'idoit_integration',
area: 'Integration::Switch',
2017-09-06 06:39:02 +00:00
description: 'Defines if i-doit (http://www.i-doit) is enabled or not.',
options: {
2017-09-06 06:39:02 +00:00
form: [
{
display: '',
null: true,
name: 'idoit_integration',
tag: 'boolean',
2017-09-06 06:39:02 +00:00
options: {
true => 'yes',
false => 'no',
},
},
],
},
state: false,
2017-09-06 06:39:02 +00:00
preferences: {
prio: 1,
2017-09-06 06:39:02 +00:00
authentication: true,
permission: ['admin.integration'],
2017-09-06 06:39:02 +00:00
},
frontend: true
2017-09-06 06:39:02 +00:00
)
Setting.create_if_not_exists(
title: 'i-doit config',
name: 'idoit_config',
area: 'Integration::Idoit',
2017-09-06 06:39:02 +00:00
description: 'Defines the i-doit config.',
options: {},
state: {},
2017-09-06 06:39:02 +00:00
preferences: {
prio: 2,
2017-09-06 06:39:02 +00:00
permission: ['admin.integration'],
},
frontend: false,
2017-09-06 06:39:02 +00:00
)
end
end