mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Add note about will_paginate previous_page method (#1801)
* Add note about will_paginate previous_page method Pagination_dict method in JSON adapter section refers only to kaminari prev_page. Newer version of will_paginate uses previous_page method. * move annotation for will_paginate's previous_page method to inline comment in example methods definition
This commit is contained in:
parent
d27b21a733
commit
e8f0dc787e
@ -81,7 +81,7 @@ def pagination_dict(object)
|
||||
{
|
||||
current_page: object.current_page,
|
||||
next_page: object.next_page,
|
||||
prev_page: object.prev_page,
|
||||
prev_page: object.prev_page, # use object.previous_page when using will_paginate
|
||||
total_pages: object.total_pages,
|
||||
total_count: object.total_count
|
||||
}
|
||||
@ -126,14 +126,13 @@ def meta_attributes(resource, extra_meta = {})
|
||||
{
|
||||
current_page: resource.current_page,
|
||||
next_page: resource.next_page,
|
||||
prev_page: resource.prev_page,
|
||||
prev_page: resource.prev_page, # use resource.previous_page when using will_paginate
|
||||
total_pages: resource.total_pages,
|
||||
total_count: resource.total_count
|
||||
}.merge(extra_meta)
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
### Attributes adapter
|
||||
|
||||
This adapter does not allow us to use `meta` key, due to that it is not possible to add pagination links.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user