tsurupin/portfolio

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

Summary

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

  def image
    object.try(:image_url)
  end
end