Refactor `WebHookFlagSerializer`.
This commit is contained in:
parent
f0024f5ec7
commit
cba3942850
|
@ -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?
|
||||||
|
|
Loading…
Reference in New Issue