Class: Granted::Grant

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/granted/models/grant.rb

Class Method Summary collapse

Class Method Details

.grantee(grantee) ⇒ Object



10
11
12
# File 'lib/granted/models/grant.rb', line 10

def self.grantee(grantee)
  where(grantee_id: grantee.id, grantee_type: grantee.class.name)
end

.subject(subject) ⇒ Object



14
15
16
# File 'lib/granted/models/grant.rb', line 14

def self.subject(subject)
  where(subject_id: subject.id, subject_type: subject.class.name)
end