From e15a45693dc77a5ef031c24072cc7a9822e0e30c Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:23:14 -0600
Subject: [PATCH 1/6] Update featured_tags_controller.rb
---
app/controllers/api/v1/accounts/featured_tags_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/api/v1/accounts/featured_tags_controller.rb b/app/controllers/api/v1/accounts/featured_tags_controller.rb
index dc01b577c1b5f..0101fb469b8bf 100644
--- a/app/controllers/api/v1/accounts/featured_tags_controller.rb
+++ b/app/controllers/api/v1/accounts/featured_tags_controller.rb
@@ -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
From 8d665b456be180b8b8d07f1432dc37c1fb23c46c Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:25:33 -0600
Subject: [PATCH 2/6] Update featured_tag_serializer.rb
---
app/serializers/rest/featured_tag_serializer.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/serializers/rest/featured_tag_serializer.rb b/app/serializers/rest/featured_tag_serializer.rb
index 08121ff16db2b..f58db0f9e805b 100644
--- a/app/serializers/rest/featured_tag_serializer.rb
+++ b/app/serializers/rest/featured_tag_serializer.rb
@@ -1,9 +1,13 @@
# frozen_string_literal: true
class REST::FeaturedTagSerializer < ActiveModel::Serializer
- attributes :id, :name, :statuses_count, :last_status_at
+ 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
From 865fb240e5e4a47d8e351ff3173b817ee045e501 Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:26:42 -0600
Subject: [PATCH 3/6] Update featured_tag_serializer.rb
---
app/serializers/rest/featured_tag_serializer.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/serializers/rest/featured_tag_serializer.rb b/app/serializers/rest/featured_tag_serializer.rb
index f58db0f9e805b..5b937f3c68367 100644
--- a/app/serializers/rest/featured_tag_serializer.rb
+++ b/app/serializers/rest/featured_tag_serializer.rb
@@ -1,7 +1,10 @@
# 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
From 2f634ce45cce2d2e19f3ec277a1ebd84026db1de Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:27:03 -0600
Subject: [PATCH 4/6] Delete account_featured_tag_serializer.rb
---
.../rest/account_featured_tag_serializer.rb | 15 ---------------
1 file changed, 15 deletions(-)
delete mode 100644 app/serializers/rest/account_featured_tag_serializer.rb
diff --git a/app/serializers/rest/account_featured_tag_serializer.rb b/app/serializers/rest/account_featured_tag_serializer.rb
deleted file mode 100644
index 84bef2e629728..0000000000000
--- a/app/serializers/rest/account_featured_tag_serializer.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class REST::AccountFeaturedTagSerializer < ActiveModel::Serializer
- include RoutingHelper
-
- attributes :id, :name, :url
-
- def id
- object.tag.id.to_s
- end
-
- def url
- short_account_tag_url(object.account, object.tag)
- end
-end
From 8a8e643f8f385b77fd8f62f211b04283c52789a7 Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:29:56 -0600
Subject: [PATCH 5/6] please codeclimate
---
app/serializers/rest/featured_tag_serializer.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/serializers/rest/featured_tag_serializer.rb b/app/serializers/rest/featured_tag_serializer.rb
index 5b937f3c68367..5fe4ab62728e0 100644
--- a/app/serializers/rest/featured_tag_serializer.rb
+++ b/app/serializers/rest/featured_tag_serializer.rb
@@ -2,14 +2,14 @@
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
From a9347c90eddc6883cba7bc0e9859c79d275e8326 Mon Sep 17 00:00:00 2001
From: trwnh
Date: Wed, 23 Dec 2020 03:32:18 -0600
Subject: [PATCH 6/6] please codeclimate
---
app/serializers/rest/featured_tag_serializer.rb | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/serializers/rest/featured_tag_serializer.rb b/app/serializers/rest/featured_tag_serializer.rb
index 5fe4ab62728e0..96adcc7d09345 100644
--- a/app/serializers/rest/featured_tag_serializer.rb
+++ b/app/serializers/rest/featured_tag_serializer.rb
@@ -5,7 +5,6 @@ class REST::FeaturedTagSerializer < ActiveModel::Serializer
attributes :id, :name, :url, :statuses_count, :last_status_at
-
def id
object.id.to_s
end