Skip to content
New issue

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

Model.class.to_s don't return Model name #56

Closed
luizcarvalho opened this issue May 5, 2014 · 1 comment
Closed

Model.class.to_s don't return Model name #56

luizcarvalho opened this issue May 5, 2014 · 1 comment

Comments

@luizcarvalho
Copy link

in file https://github.com/CanCanCommunity/cancancan/blob/develop/lib/cancan/rule.rb#L94 is do follow comparison

subject.class.to_s == sub.to_s

but ´subject.class.to_s´ aways return "Class" instead of "ModelName" . This is correct?

@bryanrite
Copy link
Member

When checking permissions on instances of class (i.e. on the show action), the instance is passed in here and instance.class.to_s will be "ModelName".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants