-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Description
I have the following Active record relationship in my application
class Client < ApplicationRecord
resourcify
end
class SupportGroup < ApplicationRecord
resourcify
end
class User < ApplicationRecord
end
I'm using rolify gem 5.x.
The actual problem is.
I have around 6k SupportGroup records in my Postgres db and I have na user 'xyz'. he is not bound to any of the support groups as an approver.
But using the following query I'm getting all 6k records
user = User.find_by!(name: 'xyz') supported_by_ids = SupportGroup.with_role(:approver, user).pluck(:id)
Expected behavior:
I should not be getting an supported_by_ids as the user('xyz') is not bound to any support group as an approver
Metadata
Metadata
Assignees
Labels
No labels