Skip to content

Commit

Permalink
TagSerializer and count (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljesusg committed Feb 14, 2018
1 parent fcb4da2 commit 1018d56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 9 additions & 0 deletions app/serializers/v1/tag_serializer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module V1
class TagSerializer < ApplicationSerializer
attribute :count_spins

def count_spins
object.taggings.count
end
end
end
9 changes: 7 additions & 2 deletions product/json_returns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ releases:
admin: []
columns:
id: "id"


tags:
attributes: ["id", "name"]
expand: []
staff: ["created_at","update_at"]
admin: []
columns:
id: "id"

0 comments on commit 1018d56

Please sign in to comment.