[openstreetmap/openstreetmap-website] Use resourceful routes for granting/revoking user roles (PR #5293)
Andy Allan
notifications at github.com
Mon Oct 28 15:13:48 UTC 2024
@gravitystorm commented on this pull request.
> + def update
@user.roles.create(:role => @role, :granter => current_user)
I would suggest that `create` is a better method name, because:
* `create` and `destroy` are more natural opposites of each other than `update` and `destroy`
* Since the next line is also `@user.roles.create(...)` then having both the controller-method-name and relation-method being the same (`create`) will make it easier for developers to understand the code.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5293#pullrequestreview-2399386368
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5293/review/2399386368 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20241028/9cf63b5a/attachment.htm>
More information about the rails-dev
mailing list