-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix deprecation by replacing _actions with actions #22
Conversation
I'm not sure it's as straight forward as just replacing it (because we are reopening the class), but I'll take a look some time in the coming week unless you do first :) |
I see. It works for my (limited) scenario, but I don't understand the details ;) |
This works fine as long as your using 2.0.0 emberjs/ember.js#12028 |
Looks like two different errors here: Not using `_actions´ doesn't work with the way we reopen the routes (or something else is wrong) in versions prior to 2.0.0. Also, on the release-version, there is a error in the test:
|
Although it wasn't in my code, should've taken the _actions deprecation more seriously. Track the proper release of a fix in kimroen/ember-cli-document-title#22
You need to detect the merged property name, and use that. For 1.x it will be var mergedActionPropertyName = (function() {
var routeProto = Ember.Route.proto();
var mergedProps = routeProto.mergedProperties;
for (var i = 0, l = mergedProps.length; i < l; i++) {
var property = mergedProps[i];
if (property === 'actions') {
return 'actions';
} else if (property === '_actions') {
return '_actions';
}
}
})();
var routeProps = {};
routeProps[mergedActionPropertyName] = {
// actions here
};
App.IndexRoute = Ember.Route.extend(routeProps); |
Working on this, but just as a note: the functionality itself does seem to be working without any changes. |
Thanks for contributing, and thanks to @rwjblue for the great suggested fix. Releasing a new version shortly which should take care of this. |
Thanks for fixing it, and sorry for not working with you to improve my initial fix. I was caught with other stuff :S |
@lucas-clemente Don't worry about it — I know the feeling :) |
No description provided.