diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-01-17 05:49:55 +1100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-04-02 15:49:05 +0100 |
commit | f6f1afd6d4d7908fd56173637fd7afbd76a8aba4 (patch) | |
tree | 4a9d059d900e138628f16f086b25c848e0ab8a5c | |
parent | 5d22285eef67627c58320f031d03d2bffd0ba55e (diff) |
Refactor using I18.with_locale
-rw-r--r-- | app/models/track_mailer.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index 51440e4d7..7262c82f3 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -91,10 +91,9 @@ class TrackMailer < ApplicationMailer if email_about_things.size > 0 # Send the email - previous_locale = I18n.locale - I18n.locale = user.get_locale - TrackMailer.deliver_event_digest(user, email_about_things) - I18n.locale = previous_locale + I18n.with_locale(user.get_locale) do + TrackMailer.deliver_event_digest(user, email_about_things) + end end # Record that we've now sent those alerts to that user |