diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-05-29 13:52:26 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-05-29 13:52:26 +0200 |
commit | c087738270e7fb16b1d284e8dd72cf99b4238bb8 (patch) | |
tree | 23327fe190fd90589c9dc8d64e96fcf0b7d28ddd /app/serializers/rest | |
parent | 8b98afa781018bc7cfdb325f6b1fca0b1edcd8cb (diff) | |
parent | 90908fc24ba57c877de75fe117b8cc234e29d4f0 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/serializers/rest')
-rw-r--r-- | app/serializers/rest/tag_serializer.rb | 11 | ||||
-rw-r--r-- | app/serializers/rest/v2/search_serializer.rb | 7 |
2 files changed, 18 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 diff --git a/app/serializers/rest/v2/search_serializer.rb b/app/serializers/rest/v2/search_serializer.rb new file mode 100644 index 000000000..cdb6b3a53 --- /dev/null +++ b/app/serializers/rest/v2/search_serializer.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class REST::V2::SearchSerializer < ActiveModel::Serializer + has_many :accounts, serializer: REST::AccountSerializer + has_many :statuses, serializer: REST::StatusSerializer + has_many :hashtags, serializer: REST::TagSerializer +end |