Commit 59c95a9c7e576271dcd7e7f38bb64f7991937bf8
1 parent
8c7bcf33
Exists in
master
and in
1 other branch
Use _action on controller
Showing
9 changed files
with
17 additions
and
17 deletions
Show diff stats
app/controllers/api/v1/stats_controller.rb
... | ... | @@ -2,8 +2,8 @@ class Api::V1::StatsController < ApplicationController |
2 | 2 | respond_to :json, :xml |
3 | 3 | |
4 | 4 | # The stats API only requires an api_key for the given app. |
5 | - skip_before_filter :authenticate_user! | |
6 | - before_filter :require_api_key_or_authenticate_user! | |
5 | + skip_before_action :authenticate_user! | |
6 | + before_action :require_api_key_or_authenticate_user! | |
7 | 7 | |
8 | 8 | def app |
9 | 9 | if problem = @app.problems.order_by(:last_notice_at.desc).first | ... | ... |
app/controllers/application_controller.rb
1 | 1 | class ApplicationController < ActionController::Base |
2 | 2 | protect_from_forgery |
3 | 3 | |
4 | - before_filter :authenticate_user_from_token! | |
5 | - before_filter :authenticate_user! | |
6 | - before_filter :set_time_zone | |
4 | + before_action :authenticate_user_from_token! | |
5 | + before_action :authenticate_user! | |
6 | + before_action :set_time_zone | |
7 | 7 | |
8 | 8 | # Devise override - After login, if there is only one app, |
9 | 9 | # redirect to that app's path instead of the root path (apps#index). | ... | ... |
app/controllers/apps_controller.rb
... | ... | @@ -2,9 +2,9 @@ class AppsController < ApplicationController |
2 | 2 | |
3 | 3 | include ProblemsSearcher |
4 | 4 | |
5 | - before_filter :require_admin!, :except => [:index, :show] | |
6 | - before_filter :parse_email_at_notices_or_set_default, :only => [:create, :update] | |
7 | - before_filter :parse_notice_at_notices_or_set_default, :only => [:create, :update] | |
5 | + before_action :require_admin!, :except => [:index, :show] | |
6 | + before_action :parse_email_at_notices_or_set_default, :only => [:create, :update] | |
7 | + before_action :parse_notice_at_notices_or_set_default, :only => [:create, :update] | |
8 | 8 | respond_to :html |
9 | 9 | |
10 | 10 | expose(:app_scope) { | ... | ... |
app/controllers/comments_controller.rb
app/controllers/deploys_controller.rb
... | ... | @@ -2,8 +2,8 @@ class DeploysController < ApplicationController |
2 | 2 | |
3 | 3 | protect_from_forgery :except => :create |
4 | 4 | |
5 | - skip_before_filter :verify_authenticity_token, :only => :create | |
6 | - skip_before_filter :authenticate_user!, :only => :create | |
5 | + skip_before_action :verify_authenticity_token, :only => :create | |
6 | + skip_before_action :authenticate_user!, :only => :create | |
7 | 7 | |
8 | 8 | def create |
9 | 9 | @app = App.find_by_api_key!(params[:api_key]) | ... | ... |
app/controllers/notices_controller.rb
... | ... | @@ -2,7 +2,7 @@ class NoticesController < ApplicationController |
2 | 2 | |
3 | 3 | class ParamsError < StandardError; end |
4 | 4 | |
5 | - skip_before_filter :authenticate_user!, :only => :create | |
5 | + skip_before_action :authenticate_user!, :only => :create | |
6 | 6 | |
7 | 7 | rescue_from ParamsError, :with => :bad_params |
8 | 8 | ... | ... |
app/controllers/problems_controller.rb
... | ... | @@ -8,7 +8,7 @@ class ProblemsController < ApplicationController |
8 | 8 | |
9 | 9 | include ProblemsSearcher |
10 | 10 | |
11 | - before_filter :need_selected_problem, :only => [ | |
11 | + before_action :need_selected_problem, :only => [ | |
12 | 12 | :resolve_several, :unresolve_several, :unmerge_several |
13 | 13 | ] |
14 | 14 | ... | ... |
app/controllers/users_controller.rb
1 | 1 | class UsersController < ApplicationController |
2 | 2 | respond_to :html |
3 | 3 | |
4 | - before_filter :require_admin!, :except => [:edit, :update] | |
5 | - before_filter :require_user_edit_priviledges, :only => [:edit, :update] | |
4 | + before_action :require_admin!, :except => [:edit, :update] | |
5 | + before_action :require_user_edit_priviledges, :only => [:edit, :update] | |
6 | 6 | |
7 | 7 | expose(:user, :attributes => :user_params) |
8 | 8 | expose(:users) { | ... | ... |
app/controllers/watchers_controller.rb
... | ... | @@ -9,7 +9,7 @@ class WatchersController < ApplicationController |
9 | 9 | app.watchers.where(:user_id => params[:id]).first |
10 | 10 | end |
11 | 11 | |
12 | - before_filter :require_watcher_edit_priviledges, :only => [:destroy] | |
12 | + before_action :require_watcher_edit_priviledges, :only => [:destroy] | |
13 | 13 | |
14 | 14 | def destroy |
15 | 15 | app.watchers.delete(watcher) | ... | ... |