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_any_role(:role1, :role2) on User Object returns Array instead of ActiveRecord::Relation
This is a rather tiny issue, but it is rather surprising, since with_role already correctly returns a Relation Object which you can easily chain.
The problem showed up when I chained other Database scopes, and the temporary solution is to do the with_any_role at the end of the chain. This conflicts with other scopes like pagination, and of course the Array cannot be evaluated lazily.
dkniffin, nhattan, khiav223577, cedv, Mehonoshin and 3 more