Skip to content

Commit

Permalink
Fix error when using granted_to with a subject ActiveRecord::Relation…
Browse files Browse the repository at this point in the history
… rather than an individual item
  • Loading branch information
Floppy committed Aug 29, 2024
1 parent 1eeea98 commit e192fa2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/concerns/caber/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def self.can_grant_permissions_to(model)

scope :granted_to, ->(permission, subject) {
includes(:caber_relations).where(
"caber_relations.subject_id": subject.id,
"caber_relations.subject_type": subject.class.name,
"caber_relations.subject": subject,
"caber_relations.permission": permission
)
}
Expand Down

0 comments on commit e192fa2

Please sign in to comment.