diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-20 21:27:06 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-20 21:27:06 -0400 |
commit | 2a7a19c93ee0e0d77e4e388d43f36a721c7ab715 (patch) | |
tree | c5e775bca4600d111d01d1bd7998d3b6252462e6 /app/models/vote.rb | |
parent | 74b1612e49ebd9cb29efb85f3afeb07f0e8d608a (diff) | |
download | thoughts-2a7a19c93ee0e0d77e4e388d43f36a721c7ab715.tar.gz thoughts-2a7a19c93ee0e0d77e4e388d43f36a721c7ab715.tar.bz2 thoughts-2a7a19c93ee0e0d77e4e388d43f36a721c7ab715.zip |
Added post voting
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 | ||