aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-17 05:49:55 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-17 05:49:55 +1100
commit622790c63b53ee2da3c385460eb49dc32511fffc (patch)
treeeb0023901c62b2ab1a9712320a188f5eeb92e6f0
parent5f6a7a29bc1ea3784728a9c57edfa4be73d4196f (diff)
Refactor using I18.with_locale
-rw-r--r--app/models/track_mailer.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb
index 7dfa87f52..03310478a 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