RestPack / restpack_serializer

Model serialization, paging, side-loading and filtering
MIT License
175 stars 43 forks source link

Permit to set a maximum page_size #70

Closed xdmx closed 10 years ago

xdmx commented 10 years ago

It would be very useful to set a maximum page_size that is allowed, especially for public APIs it would be very bad of having one loading 1000000 records.

Something like kaminari's .max_page_size. Setting it to a value it will load only up to that amount of records per page and no more.

p.s. awesome gem!

GavinJoyce commented 10 years ago

Thanks, this would be a nice addition.

It should be easy to add a config option to https://github.com/RestPack/restpack_serializer/blob/master/lib/restpack_serializer/configuration.rb

GavinJoyce commented 10 years ago

Based on this conversation, we plan to document use kaminari's configuration options for this:

https://github.com/RestPack/restpack_serializer/pull/89#issue-40418211 https://github.com/RestPack/restpack_serializer/issues/90