Add vote functionality to tracks
This commit is contained in:
parent
8b2f2b538e
commit
92b09c7de4
18 changed files with 237 additions and 19 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class Vote < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :event
|
||||
belongs_to :votable, polymorphic: true
|
||||
|
||||
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
||||
|
||||
|
|
@ -11,6 +11,6 @@ class Vote < ApplicationRecord
|
|||
private
|
||||
|
||||
def conference_id
|
||||
event.program.conference_id
|
||||
votable.program.conference_id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue