20170816000001_idoit_support.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. class IdoitSupport < ActiveRecord::Migration[4.2]
  2. def up
  3. # return if it's a new setup
  4. return if !Setting.find_by(name: 'system_init_done')
  5. Setting.create_if_not_exists(
  6. title: 'i-doit integration',
  7. name: 'idoit_integration',
  8. area: 'Integration::Switch',
  9. description: 'Defines if i-doit (http://www.i-doit) is enabled or not.',
  10. options: {
  11. form: [
  12. {
  13. display: '',
  14. null: true,
  15. name: 'idoit_integration',
  16. tag: 'boolean',
  17. options: {
  18. true => 'yes',
  19. false => 'no',
  20. },
  21. },
  22. ],
  23. },
  24. state: false,
  25. preferences: {
  26. prio: 1,
  27. authentication: true,
  28. permission: ['admin.integration'],
  29. },
  30. frontend: true
  31. )
  32. Setting.create_if_not_exists(
  33. title: 'i-doit config',
  34. name: 'idoit_config',
  35. area: 'Integration::Idoit',
  36. description: 'Defines the i-doit config.',
  37. options: {},
  38. state: {},
  39. preferences: {
  40. prio: 2,
  41. permission: ['admin.integration'],
  42. },
  43. frontend: false,
  44. )
  45. end
  46. end