Add vote functionality to tracks

This commit is contained in:
Rishabh Singh 2019-08-09 17:33:42 +05:30
parent 8b2f2b538e
commit 92b09c7de4
18 changed files with 237 additions and 19 deletions

View file

@ -18,7 +18,7 @@ class Event < ApplicationRecord
has_one :submitter_event_user, -> { where(event_role: 'submitter') }, class_name: 'EventUser'
has_one :submitter, through: :submitter_event_user, source: :user
has_many :votes, dependent: :destroy
has_many :votes, as: :votable
has_many :voters, through: :votes, source: :user
has_many :commercials, as: :commercialable, dependent: :destroy
has_many :surveys, as: :surveyable, dependent: :destroy