application.rb 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. require File.expand_path('../boot', __FILE__)
  2. require 'rails/all'
  3. # Require the gems listed in Gemfile, including any gems
  4. # you've limited to :test, :development, or :production.
  5. Bundler.require(*Rails.groups)
  6. module Zammad
  7. class Application < Rails::Application
  8. # Settings in config/environments/* take precedence over those specified here.
  9. # Application configuration should go into files in config/initializers
  10. # -- all .rb files in that directory are automatically loaded.
  11. # Do not swallow errors in after_commit/after_rollback callbacks.
  12. config.active_record.raise_in_transactional_callbacks = true
  13. # Custom directories with classes and modules you want to be autoloadable.
  14. config.autoload_paths += %W(#{config.root}/lib)
  15. # Activate observers that should always be running.
  16. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  17. config.active_record.observers =
  18. 'observer::_session',
  19. 'observer::_ticket::_close_time',
  20. 'observer::_ticket::_user_ticket_counter',
  21. 'observer::_ticket::_article_changes',
  22. 'observer::_ticket::_article::_fillup_from_general',
  23. 'observer::_ticket::_article::_fillup_from_email',
  24. 'observer::_ticket::_article::_communicate_email',
  25. 'observer::_ticket::_article::_communicate_facebook',
  26. 'observer::_ticket::_article::_communicate_twitter',
  27. 'observer::_ticket::_article::_communicate_telegram',
  28. 'observer::_ticket::_reset_new_state',
  29. 'observer::_ticket::_ref_object_touch',
  30. 'observer::_ticket::_online_notification_seen',
  31. 'observer::_ticket::_stats_reopen',
  32. 'observer::_tag::_ticket_history',
  33. 'observer::_user::_ref_object_touch',
  34. 'observer::_user::_ticket_organization',
  35. 'observer::_user::_geo',
  36. 'observer::_organization::_ref_object_touch',
  37. 'observer::_sla::_ticket_rebuild_escalation',
  38. 'observer::_transaction'
  39. # REST api path
  40. config.api_path = '/api/v1'
  41. # define cache store
  42. config.cache_store = :file_store, "#{Rails.root}/tmp/cache_file_store_#{Rails.env}"
  43. # default preferences by permission
  44. config.preferences_default_by_permission = {
  45. 'ticket.agent' => {
  46. notification_config: {
  47. matrix: {
  48. create: {
  49. criteria: {
  50. owned_by_me: true,
  51. owned_by_nobody: true,
  52. no: false,
  53. },
  54. channel: {
  55. email: true,
  56. online: true,
  57. }
  58. },
  59. update: {
  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. reminder_reached: {
  71. criteria: {
  72. owned_by_me: true,
  73. owned_by_nobody: false,
  74. no: false,
  75. },
  76. channel: {
  77. email: true,
  78. online: true,
  79. }
  80. },
  81. escalation: {
  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. }
  93. }
  94. }
  95. }
  96. end
  97. end