We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, tested with Pundit v. 0.2.1 . My application uses other names besides 'user' for user roles so as per docs I tried pundit_user in my controllers.
pundit_user
Here's a toy example that demonstrates the problem (for me at least):
class ThingysController < ApplicationController include Pundit def pundit_user WeirdlyNamedUser.new end def index @thingy = Thingy.new authorize @thingy end end
When I go to /thingys I get
Name Error in ThingysController#index undefined local variable or method `current_user' for #<ThingysController:0x007ff1f3d56a78>
The text was updated successfully, but these errors were encountered:
0.2.1 isn't using the pundit_user method, it just uses current_user: https://github.com/elabs/pundit/blob/v0.2.1/lib/pundit.rb#L68
current_user
You might want to use Pundit from the master branch or wait for a new gem release.
Sorry, something went wrong.
or just do alias_method :current_user, :my_strange_user_method
alias_method :current_user, :my_strange_user_method
OK thanks for clarifying!
No branches or pull requests
Hi, tested with Pundit v. 0.2.1 . My application uses other names besides 'user' for user roles so as per docs I tried
pundit_user
in my controllers.Here's a toy example that demonstrates the problem (for me at least):
When I go to /thingys I get
The text was updated successfully, but these errors were encountered: