tsurupin/portfolio

View on GitHub
app/serializers/cms/posts_serializer.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Cms::PostsSerializer < ActiveModel::Serializer
  format_keys :lower_camel
  attributes :id,
             :title,
             :accepted,
             :published_at,
             :status

  def published_at
    object.published_at.try(:strftime, '%b %d, %Y') || '-'
  end
end