We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07faddc commit 5ee7b4dCopy full SHA for 5ee7b4d
app/serializers/category_serializer.rb
@@ -4,7 +4,7 @@ class CategorySerializer < ActiveModel::Serializer
4
has_many :posts
5
def posts
6
post_page = (instance_options.dig(:pagaination_param, :post_page).presence || 1).to_i
7
- post_per = (instance_options.dig(:pagaination_param, :post_per).presence || 0).to_i
+ post_per = (instance_options.dig(:pagaination_param, :post_per).presence || 10).to_i
8
object.posts.published.by_date.page(post_page).per(post_per)
9
end
10
def posts_pagination
0 commit comments