Use Hash instead of Array on NotificationSetting#level enum

parent 99067a50
class NotificationSetting < ActiveRecord::Base class NotificationSetting < ActiveRecord::Base
# Notification level enum level: { disabled: 0, participating: 1, watch: 2, global: 3, mention: 4 }
# Note: When adding an option, it MUST go on the end of the array.
enum level: [:disabled, :participating, :watch, :global, :mention]
default_value_for :level, NotificationSetting.levels[:global] default_value_for :level, NotificationSetting.levels[:global]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment