Class: Decidim::Pages::PagesType

Inherits:
Core::ComponentType show all
Defined in:
decidim-pages/lib/decidim/api/pages_type.rb

Instance Method Summary collapse

Methods inherited from Core::ComponentType

authorized?

Methods inherited from Api::Types::BaseObject

allowed_to?, authorized?, determine_subject_name, local_context, permission_chain

Instance Method Details

#page(**args) ⇒ Object



18
19
20
# File 'decidim-pages/lib/decidim/api/pages_type.rb', line 18

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

#pagesObject



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

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