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
This is unexpected - can you run this with something that will show you location those queries are being generated from? Newer Rails should do it out of the box or something like https://github.com/brunofacca/active-record-query-trace will help
I've hit this as well. The location is as mentioned above, in the add method, the roles.includes call. It causes all roles to load, rather than having the DB do the work. It should be roles.exists instead.
Activity
thomas-mcdonald commentedon Apr 20, 2021
This is unexpected - can you run this with something that will show you location those queries are being generated from? Newer Rails should do it out of the box or something like https://github.com/brunofacca/active-record-query-trace will help
trein-homeroom commentedon Jul 29, 2022
I've hit this as well. The location is as mentioned above, in the add method, the roles.includes call. It causes all roles to load, rather than having the DB do the work. It should be roles.exists instead.