Skip to content

Commit

Permalink
[BUGFIX beta] ember-routing: Always inherit model from parent
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Sep 20, 2014
1 parent 3260c94 commit 3c0ac3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ember-routing/lib/system/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ var Route = EmberObject.extend(ActionHandler, {

if (!name && sawParams) { return copy(params); }
else if (!name) {
if (transition.resolveIndex !== transition.state.handlerInfos.length-1) { return; }
if (transition.resolveIndex < 1) { return; }

var parentModel = transition.state.handlerInfos[transition.resolveIndex-1].context;

Expand Down
4 changes: 2 additions & 2 deletions packages/ember/tests/routing/basic_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ test("Route inherits model from parent route", function() {
handleURL("/posts/3/shares/3");
});

test("Resource does not inherit model from parent resource", function() {
test("Resource inherits model from parent resource", function() {
expect(6);

Router.map(function() {
Expand Down Expand Up @@ -1652,7 +1652,7 @@ test("Resource does not inherit model from parent resource", function() {
afterModel: function(post, transition) {
var parent_model = this.modelFor('thePost');

notEqual(post, parent_model);
equal(post, parent_model);
}
});

Expand Down

0 comments on commit 3c0ac3d

Please sign in to comment.