Rename all before_filter to before_action, it's the same function with a new name

This commit is contained in:
Luis Ramos
2020-06-22 13:11:57 +01:00
parent 46a1c1cf26
commit 8a61257547
56 changed files with 154 additions and 154 deletions

View File

@@ -11,9 +11,9 @@ module Api
attr_accessor :current_api_user
before_filter :set_content_type
before_filter :authenticate_user
after_filter :set_jsonp_format
before_action :set_content_type
before_action :authenticate_user
after_action :set_jsonp_format
rescue_from Exception, with: :error_during_processing
rescue_from CanCan::AccessDenied, with: :unauthorized

View File

@@ -7,7 +7,7 @@ module Api
class MissingImplementationError < StandardError; end
class UnknownEnterpriseAuthorizationActionError < StandardError; end
before_filter :load_enterprise
before_action :load_enterprise
respond_to :json

View File

@@ -1,9 +1,9 @@
module Api
class EnterprisesController < Api::BaseController
before_filter :override_owner, only: [:create, :update]
before_filter :check_type, only: :update
before_filter :override_sells, only: [:create, :update]
before_filter :override_visible, only: [:create, :update]
before_action :override_owner, only: [:create, :update]
before_action :check_type, only: :update
before_action :override_sells, only: [:create, :update]
before_action :override_visible, only: [:create, :update]
respond_to :json
def create

View File

@@ -4,8 +4,8 @@ module Api
class ShipmentsController < Api::BaseController
respond_to :json
before_filter :find_order
before_filter :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
before_action :find_order
before_action :find_and_update_shipment, only: [:ship, :ready, :add, :remove]
def create
variant = scoped_variant(params[:variant_id])

View File

@@ -3,7 +3,7 @@ module Api
respond_to :json
skip_authorization_check only: [:index, :show]
before_filter :product
before_action :product
def index
@variants = scope.includes(option_values: :option_type).ransack(params[:q]).result