Sha256: b4da440d1127f1ace09310436ea2206ff53ce174e700dee3550450ab9870e043

Contents?: true

Size: 503 Bytes

Versions: 1

Compression:

Stored size: 503 Bytes

Contents

module Landable
  class TemplateSerializer < ActiveModel::Serializer
    attributes :id
    attributes :name, :body, :description
    attributes :thumbnail_url, :slug
    attributes :is_layout, :is_publishable
    attributes :file, :editable
    attributes :audit_flags
    attributes :deleted_at

    embed :ids
    has_one :published_revision

    has_many :pages
    has_one :category

    def category
      object.category || Landable::Category.where(name: 'Uncategorized').first
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
landable-1.14.0 app/serializers/landable/template_serializer.rb