forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopic_subtype.rb
56 lines (43 loc) · 947 Bytes
/
topic_subtype.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# frozen_string_literal: true
class TopicSubtype
include ActiveModel::Serialization
attr_accessor :id, :options
def initialize(id, options)
@id = id
@options = options
end
def attributes
{ "id" => @id, "options" => @options }
end
def self.list
return [] unless @archetypes.present?
@archetypes.values
end
def self.user_to_user
"user_to_user"
end
def self.system_message
"system_message"
end
def self.moderator_warning
"moderator_warning"
end
def self.notify_moderators
"notify_moderators"
end
def self.notify_user
"notify_user"
end
def self.pending_users_reminder
"pending_users"
end
def self.register(name, options = {})
@subtypes ||= {}
@subtypes[name] = TopicSubtype.new(name, options)
end
register "user_to_user"
register "system_message"
register "moderator_warning"
register "notify_moderators"
register "notify_user"
end