Closed robuye closed 10 years ago
Controller#current_policy was depending on either defining Policy class with top level namespace or overriding the method. If none of it has been done the stacktrace was very confusing, ie:
NameError: uninitialized constant Policy bundler/gems/access-granted-9a2655e7f6f9/lib/access-granted/controller_methods.rb:4:in `current_policy' bundler/gems/access-granted-9a2655e7f6f9/lib/access-granted/controller_methods.rb:12:in `can?' ruby/gems/2.0.0/gems/actionpack-3.2.14/lib/abstract_controller/helpers.rb:53:in `can?'
Now the error is:
NotImplementedError: You must implement #current_policy in ActionController.
Controller#current_policy was depending on either defining Policy class with top level namespace or overriding the method. If none of it has been done the stacktrace was very confusing, ie:
Now the error is: