mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
754ed1f45b
https://github.com/rails/rails/pull/39935 changed the behavior of `Path::Pattern#spec` and `Route#ast` to return an `Ast` rather than the root `Node`. After eager loading, however, we clear out the `Ast` to limit retained memory and these methods return `nil`. While these methods are not public and they aren't used internally after eager loading, having them return `nil` makes it difficult for applications that had been using these methods to get access to the root `Node`. This commit restores the behavior of these two methods to return the root `Node`. The `Ast` is still available via `Path::Pattern#ast`, and we still clear it out after eager loading. Now that spec is a `Node` and not an `Ast` masquerading as one, we can get rid of the delegate methods on `Ast. Since `Route#ast` now returns the root `Node`, the newly added `Route#ast_root` is no longer necessary so I've removed it. I also removed the unused `@decorated_ast` method, which should have been removed in https://github.com/rails/rails/pull/39935. |
||
---|---|---|
.. | ||
gtg | ||
nodes | ||
path | ||
route/definition | ||
router | ||
route_test.rb | ||
router_test.rb | ||
routes_test.rb |