Files
nairobi/app/models/votation_set_answer.rb
Javi Martín fda53a0a2a Remove unnecessary foreign_key options
When we specify `belongs_to :author`, ActiveRecord automatically uses
`author_id` as the foreign key.
2019-10-25 19:03:10 +02:00

7 lines
196 B
Ruby

class VotationSetAnswer < ApplicationRecord
belongs_to :votation_type
belongs_to :author, -> { with_hidden }, class_name: "User"
scope :by_author, -> (author) { where(author: author) }
end