Skip to content

Commit

Permalink
Replace before_filter with before_action
Browse files Browse the repository at this point in the history
  • Loading branch information
kalkov committed Apr 6, 2014
1 parent b6de172 commit 68968d8
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/controllers/activities_controller.rb
@@ -1,5 +1,5 @@
class ActivitiesController < ApplicationController
before_filter :require_admin
before_action :require_admin

def index
@feed = Feed.new
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/announcements_controller.rb
@@ -1,5 +1,5 @@
class AnnouncementsController < ApplicationController
before_filter :require_admin, except: :index
before_action :require_admin, except: :index

def index
@announcements = Announcement.page params[:page]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Expand Up @@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
include CustomPaths
helper CustomPaths

before_filter :set_time_zone
before_action :set_time_zone

helper_method :can_edit?, :logged_in?, :admin?

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/attributions_controller.rb
@@ -1,5 +1,5 @@
class AttributionsController < ApplicationController
before_filter :require_admin
before_action :require_admin

def new
@user = User.find params[:user_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/backdoor_controller.rb
@@ -1,5 +1,5 @@
class BackdoorController < ApplicationController
before_filter :prevent_from_execution_outside_test_environment
before_action :prevent_from_execution_outside_test_environment

def login
sign_in User.find_by_email!(params[:email])
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/challenge_checks_controller.rb
@@ -1,5 +1,5 @@
class ChallengeChecksController < ApplicationController
before_filter :require_admin
before_action :require_admin

def create
challenge_id = params[:challenge_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/challenges_controller.rb
@@ -1,5 +1,5 @@
class ChallengesController < ApplicationController
before_filter :require_admin, except: %w[index show]
before_action :require_admin, except: %w( index show )

def index
@challenges = if admin?
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/comments_controller.rb
@@ -1,6 +1,6 @@
class CommentsController < ApplicationController
before_filter :require_user
before_filter :require_editable_comment, only: [:edit, :update]
before_action :require_user
before_action :require_editable_comment, only: %w( edit update )

def create
@revision = Revision.find params[:revision_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/dashboards_controller.rb
@@ -1,5 +1,5 @@
class DashboardsController < ApplicationController
before_filter :require_user
before_action :require_user

def show
@points = current_user.points
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/hooks_controller.rb
@@ -1,6 +1,6 @@
class HooksController < ApplicationController
before_filter :require_admin, only: :index
before_filter :validate_secret_key, except: :index
before_action :require_admin, only: :index
before_action :validate_secret_key, except: :index
skip_before_action :verify_authenticity_token

def index
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/my_answers_controller.rb
@@ -1,5 +1,5 @@
class MyAnswersController < ApplicationController
before_filter :require_user
before_action :require_user

def show
@poll = Poll.find params[:poll_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/my_challenge_solutions_controller.rb
@@ -1,5 +1,5 @@
class MyChallengeSolutionsController < ApplicationController
before_filter :require_user
before_action :require_user

def show
@challenge = Challenge.find params[:challenge_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/my_solutions_controller.rb
@@ -1,5 +1,5 @@
class MySolutionsController < ApplicationController
before_filter :require_user
before_action :require_user

def show
@task = Task.find params[:task_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/points_breakdowns_controller.rb
@@ -1,5 +1,5 @@
class PointsBreakdownsController < ApplicationController
before_filter :require_admin
before_action :require_admin

def index
@points_breakdowns = PointsBreakdown.all
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/polls_controller.rb
@@ -1,5 +1,5 @@
class PollsController < ApplicationController
before_filter :require_admin, except: :index
before_action :require_admin, except: :index

def index
@polls = Poll.all
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/profiles_controller.rb
@@ -1,5 +1,5 @@
class ProfilesController < ApplicationController
before_filter :require_user
before_action :require_user

def edit
@user = current_user
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/replies_controller.rb
@@ -1,6 +1,6 @@
class RepliesController < ApplicationController
before_filter :require_user, only: [:create]
before_filter :authorize, only: [:edit, :update]
before_action :require_user, only: :create
before_action :authorize, only: %w( edit update )

def create
@topic = Topic.find params[:topic_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sign_ups_controller.rb
@@ -1,5 +1,5 @@
class SignUpsController < ApplicationController
before_filter :require_admin
before_action :require_admin

def index
@sign_ups = SignUp.all
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/solutions_controller.rb
@@ -1,5 +1,5 @@
class SolutionsController < ApplicationController
before_filter :require_admin, only: :update
before_action :require_admin, only: :update

def index
@task = Task.find params[:task_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/stars_controller.rb
@@ -1,5 +1,5 @@
class StarsController < ApplicationController
before_filter :require_admin
before_action :require_admin

def create
post = Post.find params[:post_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/task_checks_controller.rb
@@ -1,5 +1,5 @@
class TaskChecksController < ApplicationController
before_filter :require_admin
before_action :require_admin

def create
task_id = params[:task_id]
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/tasks_controller.rb
@@ -1,5 +1,5 @@
class TasksController < ApplicationController
before_filter :require_admin, except: [:index, :show, :guide]
before_action :require_admin, except: %w( index show guide )

def index
@tasks = if admin?
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/tips_controller.rb
@@ -1,5 +1,5 @@
class TipsController < ApplicationController
before_filter :require_admin, except: [:index, :show]
before_action :require_admin, except: %w( index show )

def index
if admin?
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/topics_controller.rb
@@ -1,6 +1,6 @@
class TopicsController < ApplicationController
before_filter :require_user, except: [:index, :show, :last_reply]
before_filter :authorize, only: [:edit, :update]
before_action :require_user, except: %w( index show last_reply )
before_action :authorize, only: %w( edit update )

def index
@topics = Topic.boards_page params[:page] || 1
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/voucher_claims_controller.rb
@@ -1,5 +1,5 @@
class VoucherClaimsController < ApplicationController
before_filter :require_user
before_action :require_user

def new
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/vouchers_controller.rb
@@ -1,5 +1,5 @@
class VouchersController < ApplicationController
before_filter :require_admin
before_action :require_admin

def index
@vouchers = Voucher.all
Expand Down

0 comments on commit 68968d8

Please sign in to comment.