Skip to content

Commit

Permalink
Merge pull request #73 from jhawthorn/before_action
Browse files Browse the repository at this point in the history
Replace before_filter with before_action
  • Loading branch information
stewart authored Aug 24, 2016
2 parents 1193b2c + f91aba8 commit f33ad41
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Spree::Admin::OrdersController.class_eval do
before_filter :check_authorization
before_action :check_authorization

private
def load_order_action
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Spree::Admin::Orders::CustomerDetailsController.class_eval do
before_filter :check_authorization
before_action :check_authorization

private
def check_authorization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spree/core/validators/email'
Spree::CheckoutController.class_eval do
prepend_before_filter :check_registration,
prepend_before_action :check_registration,
except: [:registration, :update_registration]
prepend_before_filter :check_authorization
prepend_before_action :check_authorization

def registration
@user = Spree::User.new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class Spree::UserRegistrationsController < Devise::RegistrationsController
include Spree::Core::ControllerHelpers::Order
include Spree::Core::ControllerHelpers::Store

before_filter :check_permissions, only: [:edit, :update]
skip_before_filter :require_no_authentication
before_action :check_permissions, only: [:edit, :update]
skip_before_action :require_no_authentication

def create
build_resource(spree_user_params)
Expand Down
6 changes: 3 additions & 3 deletions lib/controllers/frontend/spree/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Spree::UsersController < Spree::StoreController
skip_before_filter :set_current_order, only: :show
prepend_before_filter :load_object, only: [:show, :edit, :update]
prepend_before_filter :authorize_actions, only: :new
skip_before_action :set_current_order, only: :show
prepend_before_action :load_object, only: [:show, :edit, :update]
prepend_before_action :authorize_actions, only: :new

include Spree::Core::ControllerHelpers

Expand Down

0 comments on commit f33ad41

Please sign in to comment.