[openstreetmap/openstreetmap-website] Communities page (#3256)

Andy Allan notifications at github.com
Wed Jul 14 10:25:20 UTC 2021


> Are there other examples of external data such as osm-community-index being loaded into the site (so that we can follow a similar pattern)?

Not, not at the moment. But we have everything set up to use node modules (via packages.json and yarn) so we're good to go on that front. For loading the data I see two main approaches - either load it using an initializer, or create a model and load it via a memoization approach. See https://stackoverflow.com/questions/20913353/what-is-the-rails-way-to-quickly-access-static-data-at-runtime for some discussion. I lean slightly towards the model, since I suspect you'll want to write some code around that for returning records in a particular order.

Of course, if we start looking at ordering by user location (or map location) that might change the way we do things, perhaps by loading the data into the db in order to use postgres queries. We do something similar in the Language model, which essentially loads some static data into the db for further use. But in turn that opens up more discussions, like whether we should be using PostGIS for non-Node location-based queries, and that might be left for another time!

-- 
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/issues/3256#issuecomment-879777699
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210714/83d5a1a4/attachment.htm>


More information about the rails-dev mailing list