I have a User model that has the following default_scope:
default_scope where(account_id: Account.current_account.id)
If I call User.all
I always get a result based on the current account.
In some cases, for admin purposes, I'd like to bypass that scope and see all the users in the system regardless of the account.
Is there a way to do this?
Yes, with unscoped.
User.unscoped.all
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With