application.rb 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_sms',
  30. 'observer::_ticket::_article::_communicate_twitter',
  31. 'observer::_ticket::_article::_communicate_telegram',
  32. 'observer::_ticket::_reset_new_state',
  33. 'observer::_ticket::_ref_object_touch',
  34. 'observer::_ticket::_online_notification_seen',
  35. 'observer::_ticket::_stats_reopen',
  36. 'observer::_ticket::_escalation_update',
  37. 'observer::_tag::_ticket_history',
  38. 'observer::_user::_ref_object_touch',
  39. 'observer::_user::_ticket_organization',
  40. 'observer::_user::_geo',
  41. 'observer::_organization::_ref_object_touch',
  42. 'observer::_sla::_ticket_rebuild_escalation',
  43. 'observer::_transaction'
  44. config.active_job.queue_adapter = :delayed_job
  45. # Use custom logger to log Thread id next to Process pid
  46. config.log_formatter = ::Logger::Formatter.new
  47. # REST api path
  48. config.api_path = '/api/v1'
  49. # define cache store
  50. config.cache_store = :file_store, Rails.root.join('tmp', "cache_file_store_#{Rails.env}")
  51. # default preferences by permission
  52. config.preferences_default_by_permission = {
  53. 'ticket.agent' => {
  54. notification_config: {
  55. matrix: {
  56. create: {
  57. criteria: {
  58. owned_by_me: true,
  59. owned_by_nobody: true,
  60. no: false,
  61. },
  62. channel: {
  63. email: true,
  64. online: true,
  65. }
  66. },
  67. update: {
  68. criteria: {
  69. owned_by_me: true,
  70. owned_by_nobody: true,
  71. no: false,
  72. },
  73. channel: {
  74. email: true,
  75. online: true,
  76. }
  77. },
  78. reminder_reached: {
  79. criteria: {
  80. owned_by_me: true,
  81. owned_by_nobody: false,
  82. no: false,
  83. },
  84. channel: {
  85. email: true,
  86. online: true,
  87. }
  88. },
  89. escalation: {
  90. criteria: {
  91. owned_by_me: true,
  92. owned_by_nobody: false,
  93. no: false,
  94. },
  95. channel: {
  96. email: true,
  97. online: true,
  98. }
  99. }
  100. }
  101. }
  102. }
  103. }
  104. end
  105. end