[openstreetmap-website] Creating a user configurable limit for results of a changeset query (#535)
Tom Hughes
notifications at github.com
Wed Dec 4 20:55:57 UTC 2013
> @@ -202,6 +202,12 @@ def query
> bbox = BoundingBox.from_bbox_params(params)
> end
>
> + if params[:limit] and params[:limit].to_i > 0 and params[:limit].to_i < 10000
> + limit = params[:limit].to_i
> + else
> + limit = 100
I think you should throw an `OSM::APIBadUserInput` exception if the limit is not valid, rather than just ignoring it. Something like:
```ruby
raise OSM::APIBadUserInput.new("Changeset limit must be between 1 and 10000")
```
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/535/files#r8109784
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20131204/4cd35e42/attachment.html>
More information about the rails-dev
mailing list