Class: GroupOption
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- GroupOption
- Defined in:
- app/models/group_option.rb
Constant Summary collapse
- EMAIL_MESSAGES =
0
Class Method Summary collapse
-
.find_option_type_label(value) ⇒ String
Finds the label for the option type value set for a given Model.
-
.option_type_labels ⇒ String
Provides a human-readable label for the type of the option.
Instance Method Summary collapse
-
#option_type_label ⇒ String
Finds the label for the option type.
Class Method Details
.find_option_type_label(value) ⇒ String
Finds the label for the option type value set for a given Model
22 23 24 |
# File 'app/models/group_option.rb', line 22 def self.find_option_type_label(value) option_type_labels.fetch(value.to_sym, nil) end |
.option_type_labels ⇒ String
Note:
This should perhaps in the future parse from a YAML config. file
Provides a human-readable label for the type of the option
13 14 15 16 17 |
# File 'app/models/group_option.rb', line 13 def self.option_type_labels { email_messages: "E-mail messages for Group notifications" } end |
Instance Method Details
#option_type_label ⇒ String
Finds the label for the option type
28 29 30 |
# File 'app/models/group_option.rb', line 28 def option_type_label self.class.find_option_type_label(option_type) end |