[openstreetmap/openstreetmap-website] Supporting multiple API versions (#2353)

Andy Allan notifications at github.com
Fri Aug 30 11:08:24 UTC 2019


gravitystorm commented on this pull request.



> @@ -10,7 +10,7 @@ OSM = {
   MAX_REQUEST_AREA:        <%= Settings.max_request_area.to_json %>,
   SERVER_PROTOCOL:         <%= Settings.server_protocol.to_json %>,
   SERVER_URL:              <%= Settings.server_url.to_json %>,
-  API_VERSION:             <%= Settings.api_version.to_json %>,
+  API_VERSION:             <%= Settings.api_versions.min_by(&:to_f).to_json %>,

It's mainly just min_by to keep everything working for now, since it will pick 0.6 unless the site operator chooses to only deploy 0.7. 

It's used for the bits of the website that talk to the API, like notes and changeset comments. Since there's no changes yet, it's more of a "pick either" situation.

On a wider point, I'd rather work on refactoring those bits of the site to just be regular webpages like diary entry comments, but that's a different project!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2353#discussion_r319465144
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190830/26c21d10/attachment.html>


More information about the rails-dev mailing list