aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-08-01 11:28:03 +0100
committerRobin Houston <robin.houston@gmail.com>2012-08-01 11:28:03 +0100
commit021137133cd6f496b83278c2eebb558223843b7f (patch)
tree64b416d03c56f87348323d78ed0e45b57a68f3c1
parent47f1b7eb7ecdd65bac82b28ed6f18be005f2e1f5 (diff)
Set locale even for errors
The locale was not being set correctly for error pages, causing some order-dependent test failures, e.g.: script/spec spec/controllers/services_controller_spec.rb spec/integration/errors_spec.rb was failing. Many many many thanks to Louise Crow for tracking this one down!
-rw-r--r--app/controllers/application_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 11f21025c..a124743b2 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -134,6 +134,10 @@ class ApplicationController < ActionController::Base
# Make sure expiry time for session is set (before_filters are
# otherwise missed by this override)
session_remember_me
+
+ # Make sure the locale is set correctly too
+ set_gettext_locale
+
case exception
when ActiveRecord::RecordNotFound, ActionController::UnknownAction, ActionController::RoutingError
@status = 404
@@ -157,6 +161,9 @@ class ApplicationController < ActionController::Base
# otherwise missed by this override)
session_remember_me
+ # Make sure the locale is set correctly too
+ set_gettext_locale
+
# Display default, detailed error for developers
original_rescue_action_locally(exception)
end