]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Remove unnecessary layout calls from api controllers
[rails.git] / app / controllers / application_controller.rb
index f419460ee77bc97762ad6c9bc230d0718cb88c9b..a2211ea69b4fde7a7ba1c81e696b102762a4e2cd 100644 (file)
@@ -10,7 +10,9 @@ class ApplicationController < ActionController::Base
   around_action :better_errors_allow_inline, :if => proc { Rails.env.development? }
 
   attr_accessor :current_user
+
   helper_method :current_user
+  helper_method :preferred_langauges
 
   private
 
@@ -233,7 +235,7 @@ class ApplicationController < ActionController::Base
     e = e.cause
 
     if e.is_a?(Timeout::Error) ||
-       (e.is_a?(ActiveRecord::StatementInvalid) && e.message =~ /execution expired/)
+       (e.is_a?(ActiveRecord::StatementInvalid) && e.message.include?("execution expired"))
       render :action => "timeout"
     else
       raise