diff options
Diffstat (limited to 'app/models')
| -rw-r--r-- | app/models/game.rb | 13 |
1 files changed, 13 insertions, 0 deletions
| diff --git a/app/models/game.rb b/app/models/game.rb new file mode 100644 index 0000000..de33377 --- /dev/null +++ b/app/models/game.rb | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | class Game < ApplicationRecord | ||
| 2 | extend Enumerize | ||
| 3 | |||
| 4 | audited only: [:status, :progress] | ||
| 5 | |||
| 6 | validates :title, presence: true | ||
| 7 | validates :status, presence: true | ||
| 8 | |||
| 9 | enumerize :status, | ||
| 10 | in: [:playing, :upcoming, :held, :dropped, :finished], | ||
| 11 | default: :upcoming | ||
| 12 | |||
| 13 | end | ||
