Last active
June 26, 2019 15:45
-
-
Save 1dolinski/b4d15dcd545b1d242b56ee05ce3f788c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TrendingUserSerializer | |
include FastJsonapi::ObjectSerializer | |
set_type :user | |
attribute :id, :nickname, :karma, :picture | |
end | |
class TrendingListsSerializer | |
include FastJsonapi::ObjectSerializer | |
set_type :list | |
belongs_to :user, serializer: Discoveries::TrendingUserSerializer | |
attributes :created_at | |
end | |
class TrendingSerializer | |
include FastJsonapi::ObjectSerializer | |
set_type :content | |
has_many :lists, serializer: Discoveries::TrendingListsSerializer | |
attributes :url, :title, :created_at | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment