Show pending posts count in modal when your posts are enqueued

This commit is contained in:
Robin Ward
2015-04-24 15:44:59 -04:00
parent 3660fe4f60
commit 15dbce5886
10 changed files with 28 additions and 6 deletions

View File

@@ -4,7 +4,8 @@ class NewPostResultSerializer < ApplicationSerializer
attributes :action,
:post,
:errors,
:success
:success,
:pending_count
def post
post_serializer = PostSerializer.new(object.post, scope: scope, root: false)
@@ -36,4 +37,12 @@ class NewPostResultSerializer < ApplicationSerializer
object.action
end
def pending_count
object.pending_count
end
def include_pending_count?
pending_count.present?
end
end