Class: Decidim::Accountability::AccountabilityType

Inherits:
Core::ComponentType show all
Defined in:
decidim-accountability/lib/decidim/api/accountability_type.rb

Instance Method Summary collapse

Methods inherited from Core::ComponentType

authorized?

Methods inherited from Decidim::Api::Types::BaseObject

allowed_to?, authorized?, determine_subject_name, local_context, permission_chain

Instance Method Details

#result(**args) ⇒ Object



18
19
20
# File 'decidim-accountability/lib/decidim/api/accountability_type.rb', line 18

def result(**args)
  Result.where(component: object).find_by(id: args[:id])
end

#resultsObject



14
15
16
# File 'decidim-accountability/lib/decidim/api/accountability_type.rb', line 14

def results
  Result.where(component: object).includes(:component)
end