class PostSerializer < ActiveModel::Serializer
  attributes(
    :id,
    :title,
    :body,
    :created_at,
    :updated_at,
    :published_at,
    :thumbnail_url,
    :snippet
  )

  belongs_to :category
  has_one :next_post
  has_one :previous_post
  has_many :related_posts

  def thumbnail_url
    scope.image_url(object.thumbnail_url)
  end
end

class PostSerializer < ActiveModel::Serializer
  attributes(
    :id,
    :public_id,
    :title,
    :body,
    :created_at,
    :updated_at,
    :published_at,
    :thumbnail_url,
    :snippet
  )

  belongs_to :category
  has_one :next_post
  has_one :previous_post
  has_many :related_posts

  def thumbnail_url
    scope.image_url(object.thumbnail_url)
  end
end

Add public_id to API response
Add public_id to API response

Fix https://github.com/bm-sms/daimon-news-misc/issues/129
