diff options
| author | Xinhui | 2017-07-07 16:04:00 +0200 | 
|---|---|---|
| committer | Xinhui | 2017-07-07 16:04:38 +0200 | 
| commit | c427e5f8b87e715335c91a47f5fd9e0e09234048 (patch) | |
| tree | 948501e0e3533e8414bcce8c7882a14358165bd5 /app/mailers | |
| parent | 6f06b32a423abe8fb6ae7e69589eaa72d5dfe728 (diff) | |
| download | chouette-core-c427e5f8b87e715335c91a47f5fd9e0e09234048.tar.bz2 | |
Refactoring calendar mailer move users query into observer
Diffstat (limited to 'app/mailers')
| -rw-r--r-- | app/mailers/calendar_mailer.rb | 14 | 
1 files changed, 4 insertions, 10 deletions
| diff --git a/app/mailers/calendar_mailer.rb b/app/mailers/calendar_mailer.rb index f9189371e..44dcaea88 100644 --- a/app/mailers/calendar_mailer.rb +++ b/app/mailers/calendar_mailer.rb @@ -1,15 +1,9 @@  class CalendarMailer < ApplicationMailer -  def updated calendar -    users = User.all -    users.each do |u| -      mail to: u.email, subject: t('mailers.calendar_mailer.updated.subject') -    end +  def updated calendar, user +    mail to: user.email, subject: t('mailers.calendar_mailer.updated.subject')    end -  def created calendar -    users = User.all -    users.each do |u| -      mail to: u.email, subject: t('mailers.calendar_mailer.created.subject') -    end +  def created calendar, user +    mail to: user.email, subject: t('mailers.calendar_mailer.created.subject')    end  end | 
