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
When I call user.has_role?(:staff, company), the SQL query is executed, disregarding the fact that I have all the roles loaded in memory for the user. How can I avoid that? Is there a reason we couldn't make this the default?
I preload current user roles in my app like this (I use devise for auth):
When I call
user.has_role?(:staff, company)
, the SQL query is executed, disregarding the fact that I have all the roles loaded in memory for the user. How can I avoid that? Is there a reason we couldn't make this the default?https://github.com/RolifyCommunity/rolify#cached-roles-to-avoid-n1-issue
Here's the debugging output:
Thanks!
The text was updated successfully, but these errors were encountered: