about summary refs log tree commit diff
path: root/app/serializers/rest/featured_tag_serializer.rb
blob: 8abcd9b90fe362e2bdc50c303a80a74e625d75da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class REST::FeaturedTagSerializer < ActiveModel::Serializer
  include RoutingHelper

  attributes :id, :name, :url, :statuses_count, :last_status_at

  def id
    object.id.to_s
  end

  def url
    short_account_tag_url(object.account, object.tag)
  end

  def name
    object.display_name
  end
end