Class: NotificationLevelWhenReplyingSiteSetting
- Inherits:
-
EnumSiteSetting
- Object
- EnumSiteSetting
- NotificationLevelWhenReplyingSiteSetting
- Defined in:
- app/models/notification_level_when_replying_site_setting.rb
Class Method Summary collapse
- .notification_levels ⇒ Object
- .translate_names? ⇒ Boolean
- .valid_value?(val) ⇒ Boolean
- .values ⇒ Object
Class Method Details
.notification_levels ⇒ Object
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
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
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 |
.values ⇒ Object
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 |