application.rb 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. require File.expand_path('boot', __dir__)
  2. require 'rails/all'
  3. # DO NOT REMOVE THIS LINE - see issue #2037
  4. Bundler.setup
  5. # Require the gems listed in Gemfile, including any gems
  6. # you've limited to :test, :development, or :production.
  7. Bundler.require(*Rails.groups)
  8. module Zammad
  9. class Application < Rails::Application
  10. # Settings in config/environments/* take precedence over those specified here.
  11. # Application configuration should go into files in config/initializers
  12. # -- all .rb files in that directory are automatically loaded.
  13. # Custom directories with classes and modules you want to be autoloadable.
  14. config.autoload_paths += %W[#{config.root}/lib]
  15. config.eager_load_paths += %W[#{config.root}/lib]
  16. # Activate observers that should always be running.
  17. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  18. config.active_record.observers =
  19. 'observer::_session',
  20. 'observer::_ticket::_close_time',
  21. 'observer::_ticket::_last_owner_update',
  22. 'observer::_ticket::_user_ticket_counter',
  23. 'observer::_ticket::_article_changes',
  24. 'observer::_ticket::_article::_fillup_from_origin_by_id',
  25. 'observer::_ticket::_article::_fillup_from_general',
  26. 'observer::_ticket::_article::_fillup_from_email',
  27. 'observer::_ticket::_article::_communicate_email',
  28. 'observer::_ticket::_article::_communicate_facebook',
  29. 'observer::_ticket::_article::_communicate_twitter',
  30. 'observer::_ticket::_article::_communicate_telegram',
  31. 'observer::_ticket::_reset_new_state',
  32. 'observer::_ticket::_ref_object_touch',
  33. 'observer::_ticket::_online_notification_seen',
  34. 'observer::_ticket::_stats_reopen',
  35. 'observer::_ticket::_escalation_update',
  36. 'observer::_tag::_ticket_history',
  37. 'observer::_user::_ref_object_touch',
  38. 'observer::_user::_ticket_organization',
  39. 'observer::_user::_geo',
  40. 'observer::_organization::_ref_object_touch',
  41. 'observer::_sla::_ticket_rebuild_escalation',
  42. 'observer::_transaction'
  43. # REST api path
  44. config.api_path = '/api/v1'
  45. # define cache store
  46. config.cache_store = :file_store, Rails.root.join('tmp', "cache_file_store_#{Rails.env}")
  47. # default preferences by permission
  48. config.preferences_default_by_permission = {
  49. 'ticket.agent' => {
  50. notification_config: {
  51. matrix: {
  52. create: {
  53. criteria: {
  54. owned_by_me: true,
  55. owned_by_nobody: true,
  56. no: false,
  57. },
  58. channel: {
  59. email: true,
  60. online: true,
  61. }
  62. },
  63. update: {
  64. criteria: {
  65. owned_by_me: true,
  66. owned_by_nobody: true,
  67. no: false,
  68. },
  69. channel: {
  70. email: true,
  71. online: true,
  72. }
  73. },
  74. reminder_reached: {
  75. criteria: {
  76. owned_by_me: true,
  77. owned_by_nobody: false,
  78. no: false,
  79. },
  80. channel: {
  81. email: true,
  82. online: true,
  83. }
  84. },
  85. escalation: {
  86. criteria: {
  87. owned_by_me: true,
  88. owned_by_nobody: false,
  89. no: false,
  90. },
  91. channel: {
  92. email: true,
  93. online: true,
  94. }
  95. }
  96. }
  97. }
  98. }
  99. }
  100. end
  101. end