[openstreetmap/openstreetmap-website] Add Communities page (#3301)
Andy Allan
notifications at github.com
Wed Jul 27 15:55:35 UTC 2022
I've added a commit to this branch which switches to FrozenRecord, and it seems to work well. In particular, I like being able to do things like:
```ruby
@local_chapters = Community.where(:type => "osm-lc").where.not(:id => "OSMF")
```
... it feels much more rails-y this way, and makes it easier to expand in future. It also chops out a lot of parsing code - loading the communities is now only two lines of our own code, and the only significant processing logic that remains is loading the i18n.
I took the approach that the correct model is a "community" (not a local chapter) and that local chapters can be selected from the full list of communities, as above. My hope is that it makes it easier to implement other things in future, for example we could perhaps show more communities based on your language, or something like that?
My next tasks will be:
* Consider generalising the i18n parsing, so that it works for all communities and not just local chapters
* Review the communities page lede, since I've just been restyling those elsewhere
* Consider whether we should be using accessor methods (like I've done with `url`), whether that should instead be done during parsing, or whether we should just leave the raw data structure as-is (e.g. use `strings["url"]` in the views)
Any comments on all this are very welcome!
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3301#issuecomment-1196943584
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3301/c1196943584 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20220727/eb29e742/attachment.htm>
More information about the rails-dev
mailing list