You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/lib/cancan/controller_additions.rb b/lib/cancan/controller_additions.rb
index 7c3c74a..7949d2e 100644
--- a/lib/cancan/controller_additions.rb+++ b/lib/cancan/controller_additions.rb@@ -384,9 +384,12 @@ module CanCan
end
end
-if defined? ActionController- %w[Base API].each do |klass|- next unless ActionController.const_defined?(klass)- ActionController.const_get(klass).class_eval { include CanCan::ControllerAdditions }+if defined? ActionController::Base+ ActionController::Base.class_eval do+ include CanCan::ControllerAdditions+ end+elsif defined? ActionController::API+ ActionController::API.class_eval do+ include CanCan::ControllerAdditions
end
end
I think we should apply include CanCan::ControllerAdditions to both ActionController::Base and ActionController::API as CanCanCan was doing before; otherwise, applications using both controllers have to manually include ControllerAdditions in the ActionController::API classes.
The text was updated successfully, but these errors were encountered:
Hello there!
I'm trying to update from version 2.1.0 to 2.1.3 but I'm having problems regarding #457.
I have one Rails app using both kinds of controllers:
ActionController::Base
Standard ApplicationActionController::API
API-only ApplicationsThese are the changes from @Eric-Guo:
I think we should apply
include CanCan::ControllerAdditions
to bothActionController::Base
andActionController::API
as CanCanCan was doing before; otherwise, applications using both controllers have to manually includeControllerAdditions
in theActionController::API
classes.The text was updated successfully, but these errors were encountered: