Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX release] Add model hook in route blueprint
When generating a route with a dynamic segment, say via: ember g route foo --path="bar/:buzz_id" The default empty route definition will cause an awkward assertion to be thrown. * In 3.28 without any data layer, the user is prompted via assertion to implement a model hook. * In 3.28 with Ember Data, an implicit fetch via Ember Data happens. * In 4.0 without any data layer, the user would be prompted via assertion to implement a model hook. * In 4.0 with Ember Data, the user would be prompted via assertion to either add a `find` method (old assertion) or to implement a model hook (new assertion via #19858). It is doubtless that many users will still encounter these behaviors, but updating the blueprints to generate a model hook by default improves on the happy path. In theory this could do back to 3.28, however the value there is somewhat less since Ember Data's implicit store injection remains in that version (and therefore the assertions/messages are less confusing).
- Loading branch information