application.rb 3.5 KB

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