Skip to content

Commit

Permalink
upgrade before_filter to new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoorai2000 committed Sep 2, 2015
1 parent 4897d5d commit 10127f5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/comments_controller.rb
@@ -1,7 +1,7 @@
class Admin::CommentsController < Admin::BaseController
has_filters %w{all with_confirmed_hide}

before_filter :load_comment, only: [:confirm_hide, :restore]
before_action :load_comment, only: [:confirm_hide, :restore]

def index
@comments = Comment.only_hidden.send(@current_filter).page(params[:page])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/debates_controller.rb
@@ -1,7 +1,7 @@
class Admin::DebatesController < Admin::BaseController
has_filters %w{all with_confirmed_hide}, only: :index

before_filter :load_debate, only: [:confirm_hide, :restore]
before_action :load_debate, only: [:confirm_hide, :restore]

def index
@debates = Debate.only_hidden.send(@current_filter).page(params[:page])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/users_controller.rb
@@ -1,7 +1,7 @@
class Admin::UsersController < Admin::BaseController
has_filters %w{all with_confirmed_hide}, only: :index

before_filter :load_user, only: [:confirm_hide, :restore]
before_action :load_user, only: [:confirm_hide, :restore]

def index
@users = User.only_hidden.send(@current_filter).page(params[:page])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/has_filters.rb
Expand Up @@ -3,7 +3,7 @@ module HasFilters

class_methods do
def has_filters(valid_filters, *args)
before_filter(*args) do
before_action(*args) do
@valid_filters = valid_filters
@current_filter = params[:filter]
@current_filter = @valid_filters.first unless @valid_filters.include?(@current_filter)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/moderation/comments_controller.rb
@@ -1,7 +1,7 @@
class Moderation::CommentsController < Moderation::BaseController
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index

before_filter :load_comments, only: :index
before_action :load_comments, only: :index

load_and_authorize_resource

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/moderation/debates_controller.rb
@@ -1,7 +1,7 @@
class Moderation::DebatesController < Moderation::BaseController
has_filters %w{all pending_flag_review with_ignored_flag}, only: :index

before_filter :load_debates, only: :index
before_action :load_debates, only: :index

load_and_authorize_resource

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users/registrations_controller.rb
@@ -1,5 +1,5 @@
class Users::RegistrationsController < Devise::RegistrationsController
prepend_before_filter :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup]
prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup]

def create
build_resource(sign_up_params)
Expand Down

0 comments on commit 10127f5

Please sign in to comment.