[openstreetmap/openstreetmap-website] Add Communities page (#3301)
Adam Hoyle
notifications at github.com
Sun Oct 17 21:50:47 UTC 2021
@atomoil commented on this pull request.
> @@ -0,0 +1,39 @@
+module OsmCommunityIndex
+ class LocalChapter
I don't have strong feelings on exactly where the code should go, so I am happy to follow whatever structure works best for everyone.
But seeing as you ask...
Initially I was focusing on getting something running and models felt like the right place to the local_chapter data, but I didn't think too much about it. Following the first bit of feedback...
> This is just a few high level thoughts - the view stuff looks reasonably sane but while I haven't tried to understand the model stuff in detail yet it all looks pretty odd to me.
...I took a closer look at the codebase and realised that all of the models in the models folder represent database records, whereas this piece is closer to `lib/country.rb` which references a static xml file, and so I figured lib was a better place to put it.
Also I refactored the core JSON handling into `osm_community_index` to keep it separate from the specific `local_chapter` data, on the basis that osm_community_index contains more information than just local chapter information, and so _maybe_ in the future that might help, but mainly it just felt _a bit wrong_ to have a local_chapter model deal with a lot of file handling (including the localisation files).
As I say, I'm more than happy to follow whatever pattern/structure that feels right to you.
--
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/3301#discussion_r730481967
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20211017/578b0c8a/attachment.htm>
More information about the rails-dev
mailing list