From c310273606a483a9cdfd10d12da20c6b895a93fc Mon Sep 17 00:00:00 2001 From: Joseph Mastey Date: Thu, 19 Jan 2017 13:59:14 -0600 Subject: [PATCH] upgrade(rails 5): change before_filter to before_action --- app/controllers/admin_controller.rb | 2 +- app/controllers/api/v1/mobile_controller.rb | 4 ++-- app/controllers/api/v1/users_controller.rb | 8 +++++--- app/controllers/dashboard_controller.rb | 2 +- app/controllers/password_resets_controller.rb | 2 +- app/controllers/sessions_controller.rb | 4 ++-- app/controllers/tutorials_controller.rb | 4 ++-- app/controllers/users_controller.rb | 4 ++-- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index a609bb6..7302965 100755 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -1,6 +1,6 @@ class AdminController < ApplicationController before_action :administrative, :if => :admin_param, :except => [:get_user] - skip_before_filter :has_info + skip_before_action :has_info def dashboard end diff --git a/app/controllers/api/v1/mobile_controller.rb b/app/controllers/api/v1/mobile_controller.rb index f4c01e3..e4aae15 100644 --- a/app/controllers/api/v1/mobile_controller.rb +++ b/app/controllers/api/v1/mobile_controller.rb @@ -1,6 +1,6 @@ class Api::V1::MobileController < ApplicationController - skip_before_filter :authenticated - before_filter :mobile_request? + skip_before_action :authenticated + before_action :mobile_request? respond_to :json diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index d2dfa41..fc696cd 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -1,7 +1,7 @@ class Api::V1::UsersController < ApplicationController - skip_before_filter :authenticated - before_filter :valid_api_token - before_filter :extrapolate_user + skip_before_action :authenticated + before_action :valid_api_token + before_action :extrapolate_user respond_to :json @@ -22,6 +22,8 @@ class Api::V1::UsersController < ApplicationController end end + # TODO I don't believe returning from this method is a valid method + # of halting execution anymore. def identify_user(token="") # We've had issues with URL encoding, etc. causing issues so just to be safe # we will go ahead and unescape the user's token diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 685305e..cff7eb5 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,5 @@ class DashboardController < ApplicationController - skip_before_filter :has_info + skip_before_action :has_info def home @user = current_user diff --git a/app/controllers/password_resets_controller.rb b/app/controllers/password_resets_controller.rb index 98ebdab..959d828 100644 --- a/app/controllers/password_resets_controller.rb +++ b/app/controllers/password_resets_controller.rb @@ -1,5 +1,5 @@ class PasswordResetsController < ApplicationController - skip_before_filter :authenticated + skip_before_action :authenticated def reset_password user = Marshal.load(Base64.decode64(params[:user])) unless params[:user].nil? diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 8586df4..166724f 100755 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,6 +1,6 @@ class SessionsController < ApplicationController - skip_before_filter :has_info - skip_before_filter :authenticated, :only => [:new, :create] + skip_before_action :has_info + skip_before_action :authenticated, :only => [:new, :create] def new @url = params[:url] diff --git a/app/controllers/tutorials_controller.rb b/app/controllers/tutorials_controller.rb index 76022e3..e4ff5cf 100755 --- a/app/controllers/tutorials_controller.rb +++ b/app/controllers/tutorials_controller.rb @@ -1,6 +1,6 @@ class TutorialsController < ApplicationController - skip_before_filter :has_info - skip_before_filter :authenticated + skip_before_action :has_info + skip_before_action :authenticated def credentials render :partial => "layouts/tutorial/credentials/creds" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 649bbb4..b4fc055 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,6 +1,6 @@ class UsersController < ApplicationController - skip_before_filter :has_info - skip_before_filter :authenticated, :only => [:new, :create] + skip_before_action :has_info + skip_before_action :authenticated, :only => [:new, :create] def new @user = User.new