admin: fix pending demandes

fetch email with map
This commit is contained in:
Christophe Robillard 2020-02-03 16:54:31 +01:00
parent 53f420c748
commit 50fcd24b46

View file

@ -50,7 +50,7 @@ module Manager
def pending_demandes def pending_demandes
already_approved_emails = Administrateur.eager(:user) already_approved_emails = Administrateur.eager(:user)
.where(users: { email: demandes.map { |d| d[:email] } }) .where(users: { email: demandes.map { |d| d[:email] } })
.pluck(:email) .map(&:email)
demandes.reject { |demande| already_approved_emails.include?(demande[:email]) } demandes.reject { |demande| already_approved_emails.include?(demande[:email]) }
end end