Add Model changes to work with votation_types

This commit is contained in:
lalo
2019-05-29 16:51:29 +02:00
committed by Javi Martín
parent c505fd373c
commit 7c9c50f4c6
18 changed files with 745 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
class VotationSetAnswer < ApplicationRecord
belongs_to :votation_type
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
scope :by_author, -> (author) { where(author: author) }
end