Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use ActiveSupport.on_load to include CanCan::ControllerAdditions #785

Open
wants to merge 1 commit into from

6 participants

Jean Boussier Tyler Kahn Bryan Rite 8bithero Guilherme Berger Timo Schilling
Jean Boussier

This way, rails-api users will not have to manually include CanCan::ControllerAdditions.

Regards.

Jean Boussier

Fix #736

Jean Boussier

Lol, I totally forgot about that one. I can't believe it haven't been fixed yet.

Guilherme Berger

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/cancan/controller_additions.rb
4 lib/cancan/controller_additions.rb
View
@@ -385,8 +385,8 @@ def cannot?(*args)
end
end
-if defined? ActionController::Base
- ActionController::Base.class_eval do
+if defined? ActiveSupport
+ ActiveSupport.on_load :action_controller do
include CanCan::ControllerAdditions
end
end
Something went wrong with that request. Please try again.