demarches-normaliennes/app/models/avis.rb

12 lines
256 B
Ruby
Raw Normal View History

2017-04-25 12:09:11 +02:00
class Avis < ApplicationRecord
belongs_to :dossier
belongs_to :gestionnaire
scope :with_answer, -> { where.not(answer: nil) }
scope :without_answer, -> { where(answer: nil) }
def email_to_display
gestionnaire.try(:email) || email
end
2017-04-25 12:09:11 +02:00
end