Skip to content

Commit

Permalink
Support older version of Pundit
Browse files Browse the repository at this point in the history
Pundit 2.2.0 changes the Module that is required to be included, which is a breaking change. Since Pundit 2.1.x is still very viable for most apps, support both options.
  • Loading branch information
rickychilcott committed Feb 19, 2022
1 parent 030f2fc commit 6a536f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/controllers/avo/application_controller.rb
@@ -1,6 +1,11 @@
module Avo
class ApplicationController < ::ActionController::Base
include Pundit::Authorization
if defined?(Pundit::Authorization)
include Pundit::Authorization
else
include Pundit
end

include Pagy::Backend
include Avo::ApplicationHelper
include Avo::UrlHelpers
Expand Down

0 comments on commit 6a536f6

Please sign in to comment.