From 2a7a19c93ee0e0d77e4e388d43f36a721c7ab715 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 20 Oct 2023 21:27:06 -0400 Subject: Added post voting --- app/models/vote.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/models/vote.rb (limited to 'app/models/vote.rb') 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 @@ +class Vote < ApplicationRecord + belongs_to :votable, polymorphic: true + + validates :upvote, presence: true, inclusion: { in: [0, 1] } + validates :ip, presence: true +end -- cgit 1.4.1