[Fix #835] Enable asking for multiple avis at the same time

This commit is contained in:
Frederic Merizen 2018-10-31 16:09:11 +01:00
parent 31ca0552ab
commit c7358a8f53
6 changed files with 33 additions and 12 deletions

View file

@ -19,6 +19,10 @@ class Avis < ApplicationRecord
scope :by_latest, -> { order(updated_at: :desc) }
scope :updated_since?, -> (date) { where('avis.updated_at > ?', date) }
# The form allows subtmitting avis requests to several emails at once,
# hence this virtual attribute.
attr_accessor :emails
def email_to_display
gestionnaire&.email || email
end