Sha256: 1d74fd82c599600eadd9467bdb863b3b55f2c88263aab5c2d9576e4960f42c7c

Contents?: true

Size: 350 Bytes

Versions: 1

Compression:

Stored size: 350 Bytes

Contents

class PageTreeSerializer < ActiveModel::Serializer
  attributes :id, :param, :parent_page_id, :locale, :status, :news_page
  attributes :name
  attributes :published_at, :pinned

  has_many :children, serializer: PageTreeSerializer

  def children
    object.subpages.visible.in_locale(object.locale)
  end

  def param
    object.to_param
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.5.1 app/serializers/page_tree_serializer.rb