mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
437ab2031e
This PR converts the route params array into an object and moves the error generation code into its own object as well. This is a refactoring of internal code to make it easier to change and simplier for internals to interface with. We have two new objects: 1) `RouteWithParams` Previously `#generate` returned an array of parameterized parts for a route. We have now turned this into an object with a `path` and a `params methods` to be able to access the parts we need. 2) `MissingRoute` `#generate` was also responsible for constructing the message for the error. We've moved this code into the new `MissingRoute` object so it does that work instead. This change makes these methods reusable throughout the code and easier for future refactoring we plan to do. Co-authored-by: Aaron Patterson <aaron.patterson@gmail.com> |
||
---|---|---|
.. | ||
gtg | ||
nodes | ||
path | ||
route/definition | ||
router | ||
route_test.rb | ||
router_test.rb | ||
routes_test.rb |