about summary refs log tree commit diff
path: root/app/serializers/rest/account_featured_tag_serializer.rb
blob: d8d5fd68c5c5ba70c0c4e32e5bda1b17e76f4224 (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::AccountFeaturedTagSerializer < ActiveModel::Serializer
  include RoutingHelper

  attributes :id, :name, :url

  def id
    object.tag.id.to_s
  end

  def name
    "##{object.name}"
  end

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