Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use existing FeaturedTag serializer and delete AccountFeaturedTag serializer #15415

Merged
merged 6 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Api::V1::Accounts::FeaturedTagsController < Api::BaseController
respond_to :json

def index
render json: @featured_tags, each_serializer: REST::AccountFeaturedTagSerializer
render json: @featured_tags, each_serializer: REST::FeaturedTagSerializer
end

private
Expand Down
15 changes: 0 additions & 15 deletions app/serializers/rest/account_featured_tag_serializer.rb

This file was deleted.

8 changes: 7 additions & 1 deletion app/serializers/rest/featured_tag_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# frozen_string_literal: true

class REST::FeaturedTagSerializer < ActiveModel::Serializer
attributes :id, :name, :statuses_count, :last_status_at
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
end