Class: Decidim::Surveys::SurveysType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-surveys/lib/decidim/api/surveys_type.rb

Instance Method Summary collapse

Instance Method Details

#survey(**args) ⇒ Object


21
22
23
# File 'decidim-surveys/lib/decidim/api/surveys_type.rb', line 21

def survey(**args)
  Survey.where(component: object).find_by(id: args[:id])
end

#surveysObject


13
14
15
# File 'decidim-surveys/lib/decidim/api/surveys_type.rb', line 13

def surveys
  Survey.where(component: object).includes(:component)
end