We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe2d232 commit 508a712Copy full SHA for 508a712
app/serializers/post_serializer.rb
@@ -12,11 +12,11 @@ def files
12
end
13
def comments
14
comment_page = (instance_options.dig(:pagaination_param, :comment_page).presence || 1).to_i
15
- comment_per = (instance_options.dig(:pagaination_param, :comment_per).presence || 10).to_i
+ comment_per = (instance_options.dig(:pagaination_param, :comment_per).presence || 0).to_i
16
object.comments.published.by_date.page(comment_page).per(comment_per)
17
18
def comments_pagination
19
20
Pagination.build_json(comments)[:comments_pagination] if comment_per > 0
21
22
0 commit comments