RolifyCommunity / rolify

Role management library with resource scoping
https://rolifycommunity.github.io/rolify/
MIT License
3.16k stars 404 forks source link

dynamic shortcuts with resources argument error - undefined method `id' for :any:Symbol #469

Open francescob opened 6 years ago

francescob commented 6 years ago

This syntax

user.is_data_manager_of?(:any)

used to work in rolify 4.0.0

now I've upgraded to rolify 5.1.0

I got the error

NoMethodError: undefined method 'id' for :any:Symbol

while user.has_role?(:data_manager, :any) works correctly

Is this intended behavior?

dprvig commented 4 years ago

I'm encountering this issue as well. This syntax works just fine in 5.0.0, but fails in 5.1.0 (and 5.2.0). I believe the error is due to this PR https://github.com/RolifyCommunity/rolify/pull/386/files. I'm currently looking at how to resolve. cc @DmitryKK