application.rb 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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::_last_owner_update',
  21. 'observer::_ticket::_user_ticket_counter',
  22. 'observer::_ticket::_article_changes',
  23. 'observer::_ticket::_article::_fillup_from_general',
  24. 'observer::_ticket::_article::_fillup_from_email',
  25. 'observer::_ticket::_article::_fillup_from_origin_by_id',
  26. 'observer::_ticket::_article::_communicate_email',
  27. 'observer::_ticket::_article::_communicate_facebook',
  28. 'observer::_ticket::_article::_communicate_twitter',
  29. 'observer::_ticket::_article::_communicate_telegram',
  30. 'observer::_ticket::_reset_new_state',
  31. 'observer::_ticket::_ref_object_touch',
  32. 'observer::_ticket::_online_notification_seen',
  33. 'observer::_ticket::_stats_reopen',
  34. 'observer::_tag::_ticket_history',
  35. 'observer::_user::_ref_object_touch',
  36. 'observer::_user::_ticket_organization',
  37. 'observer::_user::_geo',
  38. 'observer::_organization::_ref_object_touch',
  39. 'observer::_sla::_ticket_rebuild_escalation',
  40. 'observer::_transaction'
  41. # REST api path
  42. config.api_path = '/api/v1'
  43. # define cache store
  44. config.cache_store = :file_store, "#{Rails.root}/tmp/cache_file_store_#{Rails.env}"
  45. # default preferences by permission
  46. config.preferences_default_by_permission = {
  47. 'ticket.agent' => {
  48. notification_config: {
  49. matrix: {
  50. create: {
  51. criteria: {
  52. owned_by_me: true,
  53. owned_by_nobody: true,
  54. no: false,
  55. },
  56. channel: {
  57. email: true,
  58. online: true,
  59. }
  60. },
  61. update: {
  62. criteria: {
  63. owned_by_me: true,
  64. owned_by_nobody: true,
  65. no: false,
  66. },
  67. channel: {
  68. email: true,
  69. online: true,
  70. }
  71. },
  72. reminder_reached: {
  73. criteria: {
  74. owned_by_me: true,
  75. owned_by_nobody: false,
  76. no: false,
  77. },
  78. channel: {
  79. email: true,
  80. online: true,
  81. }
  82. },
  83. escalation: {
  84. criteria: {
  85. owned_by_me: true,
  86. owned_by_nobody: false,
  87. no: false,
  88. },
  89. channel: {
  90. email: true,
  91. online: true,
  92. }
  93. }
  94. }
  95. }
  96. }
  97. }
  98. end
  99. end