rails
rails copied to clipboard
[Fix #51463] Raise an error when invalid `:on` or `:except` options are given to `#resource` or `#resources`
Motivation / Background
Fixes https://github.com/rails/rails/issues/51463.
Detail
Raises an ArgumentError
when a ActionDispatch::Routing::Mapper::Resources::Resource
is initalized with :on
or :except
options that aren't default (index, create, new, show, update, and destroy) actions .
Additional information
See my comment below as to why this seems like more changes than it needs to be.
Checklist
Before submitting the PR make sure the following are checked:
- [x] This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
- [x] Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex:
[Fix #issue-number]
- [x] Tests are added or updated if you fix a bug or add a feature.
- [x] CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.