Change validation scope and Fix tests

This commit is contained in:
Kaustubh Nair 2019-04-06 00:09:20 +05:30
parent b9cb0804ef
commit 9fdd372f18
2 changed files with 3 additions and 5 deletions

View file

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