application.rb 4.0 KB

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