application.rb 3.3 KB

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