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. # Custom directories with classes and modules you want to be autoloadable.
  12. config.autoload_paths += %W(#{config.root}/lib)
  13. config.eager_load_paths += %W(#{config.root}/lib)
  14. # Activate observers that should always be running.
  15. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  16. config.active_record.observers =
  17. 'observer::_session',
  18. 'observer::_ticket::_close_time',
  19. 'observer::_ticket::_last_owner_update',
  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::_fillup_from_origin_by_id',
  25. 'observer::_ticket::_article::_communicate_email',
  26. 'observer::_ticket::_article::_communicate_facebook',
  27. 'observer::_ticket::_article::_communicate_twitter',
  28. 'observer::_ticket::_article::_communicate_telegram',
  29. 'observer::_ticket::_reset_new_state',
  30. 'observer::_ticket::_ref_object_touch',
  31. 'observer::_ticket::_online_notification_seen',
  32. 'observer::_ticket::_stats_reopen',
  33. 'observer::_tag::_ticket_history',
  34. 'observer::_user::_ref_object_touch',
  35. 'observer::_user::_ticket_organization',
  36. 'observer::_user::_geo',
  37. 'observer::_organization::_ref_object_touch',
  38. 'observer::_sla::_ticket_rebuild_escalation',
  39. 'observer::_transaction'
  40. # REST api path
  41. config.api_path = '/api/v1'
  42. # define cache store
  43. config.cache_store = :file_store, "#{Rails.root}/tmp/cache_file_store_#{Rails.env}"
  44. # default preferences by permission
  45. config.preferences_default_by_permission = {
  46. 'ticket.agent' => {
  47. notification_config: {
  48. matrix: {
  49. create: {
  50. criteria: {
  51. owned_by_me: true,
  52. owned_by_nobody: true,
  53. no: false,
  54. },
  55. channel: {
  56. email: true,
  57. online: true,
  58. }
  59. },
  60. update: {
  61. criteria: {
  62. owned_by_me: true,
  63. owned_by_nobody: true,
  64. no: false,
  65. },
  66. channel: {
  67. email: true,
  68. online: true,
  69. }
  70. },
  71. reminder_reached: {
  72. criteria: {
  73. owned_by_me: true,
  74. owned_by_nobody: false,
  75. no: false,
  76. },
  77. channel: {
  78. email: true,
  79. online: true,
  80. }
  81. },
  82. escalation: {
  83. criteria: {
  84. owned_by_me: true,
  85. owned_by_nobody: false,
  86. no: false,
  87. },
  88. channel: {
  89. email: true,
  90. online: true,
  91. }
  92. }
  93. }
  94. }
  95. }
  96. }
  97. end
  98. end