Class: WebHookEventType

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/web_hook_event_type.rb

Constant Summary collapse

TOPIC =
1
POST =
2
USER =
3
GROUP =
4
CATEGORY =
5
TAG =
6
REVIEWABLE =
9
NOTIFICATION =
10
SOLVED =
11
ASSIGN =
12
USER_BADGE =
13
GROUP_USER =
14
LIKE =
15
USER_PROMOTED =
16
TOPIC_VOTING =
17
CHAT_MESSAGE =
18

Class Method Summary collapse

Class Method Details

.activeObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/models/web_hook_event_type.rb', line 27

def self.active
  ids_to_exclude = []
  unless defined?(SiteSetting.solved_enabled) && SiteSetting.solved_enabled
    ids_to_exclude << SOLVED
  end
  unless defined?(SiteSetting.assign_enabled) && SiteSetting.assign_enabled
    ids_to_exclude << ASSIGN
  end
  unless defined?(SiteSetting.voting_enabled) && SiteSetting.voting_enabled
    ids_to_exclude << TOPIC_VOTING
  end
  unless defined?(SiteSetting.chat_enabled) && SiteSetting.chat_enabled
    ids_to_exclude << CHAT_MESSAGE
  end

  self.where.not(id: ids_to_exclude)
end