tsurupin/portfolio

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

Summary

Maintainability
A
0 mins
Test Coverage
class Cms::ProjectsSerializer < ActiveModel::Serializer
  format_keys :lower_camel
  has_many :tags
  attributes :id,
             :title,
             :description,
             :image,
             :caption,
             :source_url,
             :accepted

  def image
    object.try(:image_url)
  end
end