[openstreetmap/openstreetmap-website] Collect node/way/relation CanCanCan subjects into arrays (PR #4575)

Anton Khorev notifications at github.com
Wed Mar 13 23:52:02 UTC 2024


Different element types usually have the same actions with three very similar lines in ability files. It's possible to turn them into one line, also decreasing the complexity Rubocop complains about. I still have PRs where I need to increase complexity limits like #4301. After this change I won't have to do it.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4575

-- Commit Summary --

  * Collect node/way/relation CanCanCan subjects into arrays

-- File Changes --

    M app/abilities/ability.rb (4)
    M app/abilities/api_ability.rb (10)
    M app/abilities/api_capability.rb (10)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4575.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4575.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4575
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4575 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240313/a3d890b4/attachment.htm>


More information about the rails-dev mailing list