diff options
Diffstat (limited to 'app/models/vote.rb')
-rw-r--r-- | app/models/vote.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/vote.rb b/app/models/vote.rb new file mode 100644 index 0000000..e2d8386 --- /dev/null +++ b/app/models/vote.rb | |||
@@ -0,0 +1,6 @@ | |||
1 | class Vote < ApplicationRecord | ||
2 | belongs_to :votable, polymorphic: true | ||
3 | |||
4 | validates :upvote, presence: true, inclusion: { in: [0, 1] } | ||
5 | validates :ip, presence: true | ||
6 | end | ||