Class: Decidim::Pages::PagesType

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

Instance Method Summary collapse

Instance Method Details

#page(**args) ⇒ Object


21
22
23
# File 'decidim-pages/lib/decidim/api/pages_type.rb', line 21

def page(**args)
  Page.where(component: object).find_by(id: args[:id])
end

#pagesObject


13
14
15
# File 'decidim-pages/lib/decidim/api/pages_type.rb', line 13

def pages
  Page.where(component: object).includes(:component)
end