application.rb 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. config.active_job.queue_adapter = :delayed_job
  44. # REST api path
  45. config.api_path = '/api/v1'
  46. # define cache store
  47. config.cache_store = :file_store, Rails.root.join('tmp', "cache_file_store_#{Rails.env}")
  48. # default preferences by permission
  49. config.preferences_default_by_permission = {
  50. 'ticket.agent' => {
  51. notification_config: {
  52. matrix: {
  53. create: {
  54. criteria: {
  55. owned_by_me: true,
  56. owned_by_nobody: true,
  57. no: false,
  58. },
  59. channel: {
  60. email: true,
  61. online: true,
  62. }
  63. },
  64. update: {
  65. criteria: {
  66. owned_by_me: true,
  67. owned_by_nobody: true,
  68. no: false,
  69. },
  70. channel: {
  71. email: true,
  72. online: true,
  73. }
  74. },
  75. reminder_reached: {
  76. criteria: {
  77. owned_by_me: true,
  78. owned_by_nobody: false,
  79. no: false,
  80. },
  81. channel: {
  82. email: true,
  83. online: true,
  84. }
  85. },
  86. escalation: {
  87. criteria: {
  88. owned_by_me: true,
  89. owned_by_nobody: false,
  90. no: false,
  91. },
  92. channel: {
  93. email: true,
  94. online: true,
  95. }
  96. }
  97. }
  98. }
  99. }
  100. }
  101. end
  102. end