diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/track_mailer.rb | 7 | ||||
-rw-r--r-- | app/models/user.rb | 7 |
2 files changed, 4 insertions, 10 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 diff --git a/app/models/user.rb b/app/models/user.rb index 490587c39..bc04b5449 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,12 +90,7 @@ class User < ActiveRecord::Base end def get_locale - if !self.locale.nil? - locale = self.locale - else - locale = I18n.locale - end - return locale.to_s + (self.locale || I18n.locale).to_s end def visible_comments |