From 59c95a9c7e576271dcd7e7f38bb64f7991937bf8 Mon Sep 17 00:00:00 2001 From: Arthur Neves Date: Thu, 1 Jan 2015 14:27:30 -0500 Subject: [PATCH] Use _action on controller --- app/controllers/api/v1/stats_controller.rb | 4 ++-- app/controllers/application_controller.rb | 6 +++--- app/controllers/apps_controller.rb | 6 +++--- app/controllers/comments_controller.rb | 4 ++-- app/controllers/deploys_controller.rb | 4 ++-- app/controllers/notices_controller.rb | 2 +- app/controllers/problems_controller.rb | 2 +- app/controllers/users_controller.rb | 4 ++-- app/controllers/watchers_controller.rb | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/controllers/api/v1/stats_controller.rb b/app/controllers/api/v1/stats_controller.rb index a173423..fcd646f 100644 --- a/app/controllers/api/v1/stats_controller.rb +++ b/app/controllers/api/v1/stats_controller.rb @@ -2,8 +2,8 @@ class Api::V1::StatsController < ApplicationController respond_to :json, :xml # The stats API only requires an api_key for the given app. - skip_before_filter :authenticate_user! - before_filter :require_api_key_or_authenticate_user! + skip_before_action :authenticate_user! + before_action :require_api_key_or_authenticate_user! def app if problem = @app.problems.order_by(:last_notice_at.desc).first diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c50e060..cd42cb3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,9 +1,9 @@ class ApplicationController < ActionController::Base protect_from_forgery - before_filter :authenticate_user_from_token! - before_filter :authenticate_user! - before_filter :set_time_zone + before_action :authenticate_user_from_token! + before_action :authenticate_user! + before_action :set_time_zone # Devise override - After login, if there is only one app, # redirect to that app's path instead of the root path (apps#index). diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index 3ce07b4..0973fe5 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -2,9 +2,9 @@ class AppsController < ApplicationController include ProblemsSearcher - before_filter :require_admin!, :except => [:index, :show] - before_filter :parse_email_at_notices_or_set_default, :only => [:create, :update] - before_filter :parse_notice_at_notices_or_set_default, :only => [:create, :update] + before_action :require_admin!, :except => [:index, :show] + before_action :parse_email_at_notices_or_set_default, :only => [:create, :update] + before_action :parse_notice_at_notices_or_set_default, :only => [:create, :update] respond_to :html expose(:app_scope) { diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 01cd064..3b16728 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -1,6 +1,6 @@ class CommentsController < ApplicationController - before_filter :find_app - before_filter :find_problem + before_action :find_app + before_action :find_problem def create @comment = Comment.new(comment_params.merge(:user_id => current_user.id)) diff --git a/app/controllers/deploys_controller.rb b/app/controllers/deploys_controller.rb index 4490a07..a376a38 100644 --- a/app/controllers/deploys_controller.rb +++ b/app/controllers/deploys_controller.rb @@ -2,8 +2,8 @@ class DeploysController < ApplicationController protect_from_forgery :except => :create - skip_before_filter :verify_authenticity_token, :only => :create - skip_before_filter :authenticate_user!, :only => :create + skip_before_action :verify_authenticity_token, :only => :create + skip_before_action :authenticate_user!, :only => :create def create @app = App.find_by_api_key!(params[:api_key]) diff --git a/app/controllers/notices_controller.rb b/app/controllers/notices_controller.rb index 3542556..6cb9076 100644 --- a/app/controllers/notices_controller.rb +++ b/app/controllers/notices_controller.rb @@ -2,7 +2,7 @@ class NoticesController < ApplicationController class ParamsError < StandardError; end - skip_before_filter :authenticate_user!, :only => :create + skip_before_action :authenticate_user!, :only => :create rescue_from ParamsError, :with => :bad_params diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb index a1759a3..6e9f24d 100644 --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -8,7 +8,7 @@ class ProblemsController < ApplicationController include ProblemsSearcher - before_filter :need_selected_problem, :only => [ + before_action :need_selected_problem, :only => [ :resolve_several, :unresolve_several, :unmerge_several ] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7f93168..2e606ed 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,8 +1,8 @@ class UsersController < ApplicationController respond_to :html - before_filter :require_admin!, :except => [:edit, :update] - before_filter :require_user_edit_priviledges, :only => [:edit, :update] + before_action :require_admin!, :except => [:edit, :update] + before_action :require_user_edit_priviledges, :only => [:edit, :update] expose(:user, :attributes => :user_params) expose(:users) { diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 63c8d43..28be9d8 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -9,7 +9,7 @@ class WatchersController < ApplicationController app.watchers.where(:user_id => params[:id]).first end - before_filter :require_watcher_edit_priviledges, :only => [:destroy] + before_action :require_watcher_edit_priviledges, :only => [:destroy] def destroy app.watchers.delete(watcher) -- libgit2 0.21.2