Class: Decidim::ActionDelegator::GranteeDelegations

Inherits:
Object
  • Object
show all
Defined in:
app/queries/decidim/action_delegator/grantee_delegations.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(consultation, user) ⇒ GranteeDelegations

Returns a new instance of GranteeDelegations.



10
11
12
13
# File 'app/queries/decidim/action_delegator/grantee_delegations.rb', line 10

def initialize(consultation, user)
  @consultation = consultation
  @user = user
end

Class Method Details

.for(consultation, user) ⇒ Object



6
7
8
# File 'app/queries/decidim/action_delegator/grantee_delegations.rb', line 6

def self.for(consultation, user)
  new(consultation, user).query
end

Instance Method Details

#queryObject



15
16
17
# File 'app/queries/decidim/action_delegator/grantee_delegations.rb', line 15

def query
  ConsultationDelegations.for(consultation).where(grantee_id: user.id)
end