diff options
Diffstat (limited to 'app/models/score.rb')
-rw-r--r-- | app/models/score.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/score.rb b/app/models/score.rb new file mode 100644 index 0000000..1958389 --- /dev/null +++ b/app/models/score.rb | |||
@@ -0,0 +1,7 @@ | |||
1 | class Score < ApplicationRecord | ||
2 | belongs_to :puzzle | ||
3 | |||
4 | validates :name, presence: true | ||
5 | validates :ip, presence: true | ||
6 | validates_uniqueness_of :name, scope: :puzzle_id | ||
7 | end | ||