]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/application_controller.rb
Fix some rubocop todos
[rails.git] / app / controllers / application_controller.rb
index 616223a068c65a11df26afba4b1e0cc8451fa4d9..f1e847e109dc48afef4f834bb3232ad6e551344e 100644 (file)
@@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base
 
   protect_from_forgery :with => :exception
 
+  add_flash_types :warning, :error
+
   rescue_from CanCan::AccessDenied, :with => :deny_access
   check_authorization
 
@@ -10,8 +12,10 @@ class ApplicationController < ActionController::Base
   around_action :better_errors_allow_inline, :if => proc { Rails.env.development? }
 
   attr_accessor :current_user
+  attr_accessor :oauth_token
 
   helper_method :current_user
+  helper_method :oauth_token
   helper_method :preferred_langauges
 
   private
@@ -56,7 +60,7 @@ class ApplicationController < ActionController::Base
   end
 
   def require_oauth
-    @oauth = current_user.access_token(Settings.oauth_key) if current_user && Settings.key?(:oauth_key)
+    @oauth_token = current_user.access_token(Settings.oauth_key) if current_user && Settings.key?(:oauth_key)
   end
 
   ##