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