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
Definitely think this is a bug. I want to make sure I'm thinking through all the cases here.
has_global_records uses nil to find all the tenant's records and records unassociated with a tenant. That's effectively what is going on here.
I'm thinking we want:
If Account.id is nil and has_global_records: false we should return Project.where(account_id: [])
If Account.id is 1 and has_global_records: false we should return Project.where(account_id: [1])
If Account.id is nil and has_global_records: true we should return Project.where(account_id: [nil])
If Account.id is 1 and has_global_records: true we should return Project.where(account_id: [1, nil])
If accidently scoping is done on an object with invalid id (null or non numeric) - scoping is ignored
The text was updated successfully, but these errors were encountered: