Class: NotificationLevelWhenReplyingSiteSetting

Inherits:
EnumSiteSetting show all
Defined in:
app/models/notification_level_when_replying_site_setting.rb

Class Method Summary collapse

Class Method Details

.notification_levelsObject



8
9
10
# File 'app/models/notification_level_when_replying_site_setting.rb', line 8

def self.notification_levels
  NotificationLevels.topic_levels
end

.translate_names?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/models/notification_level_when_replying_site_setting.rb', line 20

def self.translate_names?
  true
end

.valid_value?(val) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'app/models/notification_level_when_replying_site_setting.rb', line 4

def self.valid_value?(val)
  val.to_i.to_s == val.to_s && values.any? { |v| v[:value] == val.to_i }
end

.valuesObject



12
13
14
15
16
17
18
# File 'app/models/notification_level_when_replying_site_setting.rb', line 12

def self.values
  @values ||= [
    { name: "topic.notifications.watching.title", value: notification_levels[:watching] },
    { name: "topic.notifications.tracking.title", value: notification_levels[:tracking] },
    { name: "topic.notifications.regular.title", value: notification_levels[:regular] },
  ]
end