Skip to content

Commit

Permalink
Merge pull request #6 from manyfold3d/fix-granted-to-with-relation
Browse files Browse the repository at this point in the history
Fix error when using granted_to with a subject ActiveRecord::Relation
  • Loading branch information
Floppy authored Aug 29, 2024
2 parents 1eeea98 + e192fa2 commit 41b2eff
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 41b2eff

Please sign in to comment.