Add uniqueness validation for votes

This commit is contained in:
Kaustubh Nair 2019-04-03 18:51:07 +05:30
parent b2e6c1b701
commit b9cb0804ef
2 changed files with 21 additions and 0 deletions

View file

@ -6,6 +6,8 @@ class Vote < ApplicationRecord
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
validates :event, uniqueness: { scope: :user }
delegate :name, to: :user
private