Use Hash instead of Array on NotificationSetting#level enum

This commit is contained in:
Douglas Barbosa Alexandre 2016-04-11 10:23:40 -03:00
parent 99067a505c
commit 73fdd4b83d
1 changed files with 1 additions and 3 deletions

View File

@ -1,7 +1,5 @@
class NotificationSetting < ActiveRecord::Base
# Notification level
# Note: When adding an option, it MUST go on the end of the array.
enum level: [:disabled, :participating, :watch, :global, :mention]
enum level: { disabled: 0, participating: 1, watch: 2, global: 3, mention: 4 }
default_value_for :level, NotificationSetting.levels[:global]