Removing deprecation warning (#16572)
Prior to this commit, I saw the following in the Rails test log: ``` DEPRECATION WARNING: 'include Pundit' is deprecated. Please use 'include Pundit::Authorization' instead. (called from include at ./app/controllers/application_controller.rb:12) ```
This commit is contained in:
parent
3982b389f1
commit
663a712a10
2 changed files with 3 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
module Api
|
||||
module V0
|
||||
class ListingsController < ApiController
|
||||
include Pundit
|
||||
include Pundit::Authorization
|
||||
include ListingsToolkit
|
||||
|
||||
# actions `create` and `update` are defined in the module `ListingsToolkit`,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
include SessionCurrentUser
|
||||
include ValidRequest
|
||||
include Pundit
|
||||
include Pundit::Authorization
|
||||
include CachingHeaders
|
||||
include ImageUploads
|
||||
include DevelopmentDependencyChecks if Rails.env.development?
|
||||
|
|
@ -74,7 +74,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def not_authorized
|
||||
render json: { error: I18n.t("application_controller.not_authorized") }, status: :unauthorized
|
||||
raise NotAuthorizedError, "Unauthorized"
|
||||
raise Pundit::NotAuthorizedError, "Unauthorized"
|
||||
end
|
||||
|
||||
def bad_request
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue