File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -237,12 +237,12 @@ class CategorySerializer < ActiveModel::Serializer
237
237
has_one :user
238
238
has_many :posts
239
239
def posts
240
- post_page = instance_options.dig(:pagaination_param, :post_page).presence.to_i || 1
241
- post_per = instance_options.dig(:pagaination_param, :post_per).presence.to_i || 10
240
+ post_page = ( instance_options.dig(:pagaination_param, :post_page).presence || 1).to_i
241
+ post_per = ( instance_options.dig(:pagaination_param, :post_per).presence || 0).to_i
242
242
object.posts.published.by_date.page(post_page).per(post_per)
243
243
end
244
244
def posts_pagination
245
- post_per = instance_options.dig(:pagaination_param, :post_per).presence.to_i || 10
245
+ post_per = ( instance_options.dig(:pagaination_param, :post_per).presence || 10).to_i
246
246
Pagination.build_json(posts)[:posts_pagination] if post_per > 0
247
247
end
248
248
end
You can’t perform that action at this time.
0 commit comments