Refactor `WebHookFlagSerializer`.

This commit is contained in:
Guo Xiang Tan 2018-05-21 11:37:16 +08:00
parent f0024f5ec7
commit cba3942850
1 changed files with 2 additions and 4 deletions

View File

@ -8,7 +8,7 @@ class WebHookFlagSerializer < ApplicationSerializer
:resolved_by :resolved_by
def post def post
BasicPostSerializer.new(object.post, scope: scope, root: false).as_json WebHookPostSerializer.new(object.post, scope: scope, root: false).as_json
end end
def flag_type def flag_type
@ -32,9 +32,7 @@ class WebHookFlagSerializer < ApplicationSerializer
end end
def resolved_by def resolved_by
if object.disposed_by_id.present? User.find(object.disposed_by_id).username
User.find(object.disposed_by_id).username
end
end end
def include_resolved_by? def include_resolved_by?