[Fix #1808] Use &. where possible

This commit is contained in:
gregoirenovel 2018-05-30 18:45:46 +02:00
parent 9df649d8cc
commit dc045bdefb
14 changed files with 26 additions and 26 deletions

View file

@ -19,7 +19,7 @@ class Avis < ApplicationRecord
scope :updated_since?, -> (date) { where('avis.updated_at > ?', date) }
def email_to_display
gestionnaire.try(:email) || email
gestionnaire&.email || email
end
def self.link_avis_to_gestionnaire(gestionnaire)
@ -27,8 +27,7 @@ class Avis < ApplicationRecord
end
def self.avis_exists_and_email_belongs_to_avis?(avis_id, email)
avis = Avis.find_by(id: avis_id)
avis.present? && avis.email == email
Avis.find_by(id: avis_id)&.email == email
end
private