20190626000001_setting_update_karma_level.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class SettingUpdateKarmaLevel < ActiveRecord::Migration[5.1]
  3. def up
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.set(
  7. 'karma_levels',
  8. [
  9. {
  10. name: 'Beginner',
  11. start: 0,
  12. end: 499,
  13. },
  14. {
  15. name: 'Newbie',
  16. start: 500,
  17. end: 1999,
  18. },
  19. {
  20. name: 'Intermediate',
  21. start: 2000,
  22. end: 4999,
  23. },
  24. {
  25. name: 'Professional',
  26. start: 5000,
  27. end: 6999,
  28. },
  29. {
  30. name: 'Expert',
  31. start: 7000,
  32. end: 8999,
  33. },
  34. {
  35. name: 'Master',
  36. start: 9000,
  37. end: 18_999,
  38. },
  39. {
  40. name: 'Evangelist',
  41. start: 19_000,
  42. end: 49_999,
  43. },
  44. {
  45. name: 'Hero',
  46. start: 50_000,
  47. end: nil,
  48. }
  49. ],
  50. )
  51. end
  52. end