about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-27 21:45:30 +0200
committerGitHub <noreply@github.com>2018-05-27 21:45:30 +0200
commit9bd23dc4e51ba47283a8e3a66cd94b4e624a5235 (patch)
tree119802887a7b894ea3aac5e28a8a7a15524c1c35 /app/serializers
parent63c7b9157274f57c496399a1a5c728b32415034c (diff)
Track trending tags (#7638)
* Track trending tags

- Half-life of 1 day
- Historical usage in daily buckets (last 7 days stored)
- GET /api/v1/trends

Fix #271

* Add trends to web UI

* Don't render compose form on search route, adjust search results header

* Disqualify tag from trends if it's in disallowed hashtags setting

* Count distinct accounts using tag, ignore silenced accounts
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/tag_serializer.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/serializers/rest/tag_serializer.rb b/app/serializers/rest/tag_serializer.rb
new file mode 100644
index 000000000..74aa571a4
--- /dev/null
+++ b/app/serializers/rest/tag_serializer.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class REST::TagSerializer < ActiveModel::Serializer
+  include RoutingHelper
+
+  attributes :name, :url, :history
+
+  def url
+    tag_url(object)
+  end
+end