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
With both rules Item.accessible_by(current_ability) will return the correct results. But only the 2nd rule will work with can? :manage, Item.accessible_by(current_ability).first
This is because the symbols are not translated to a string the usual way rails does.
Not sure if really a bug or a not.
[EDIT] I believe this is a bug, just because of the unexpected behavior.
The text was updated successfully, but these errors were encountered:
I believe this to be a bug, at least it's something new users will surely trip over and I can't think of a good and valid use case for wanting that behavior (since it does work differently on ActiveRecord queries)
Hello,
I found this blog post that explain the problem I'm having:
http://www.tigraine.at/2014/03/13/cancan-beware-of-symbol-conditions
Basically, if you look at the following rules:
With both rules
Item.accessible_by(current_ability)
will return the correct results. But only the 2nd rule will work withcan? :manage, Item.accessible_by(current_ability).first
This is because the symbols are not translated to a string the usual way rails does.
Not sure if really a bug or a not.
[EDIT] I believe this is a bug, just because of the unexpected behavior.
The text was updated successfully, but these errors were encountered: