Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Updates code to current practices (#924)
Browse files Browse the repository at this point in the history
`Ember.on` and `Ember.computed` are currently preferred over the prototype extensions `Function.prototype.on` and `Function.prototype.property`.
  • Loading branch information
locks authored and jkleinsc committed Jan 19, 2017
1 parent 7d6cba0 commit ba6c524
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export default Ember.Controller.extend(UserSession, {
'Users'
],

setupPermissions: function() {
setupPermissions: Ember.on('init', function() {
let permissions = this.get('defaultCapabilities');
for (let capability in permissions) {
if (this.currentUserCan(capability)) {
this.set(`userCan_${capability}`, true);
}
}
}.on('init'),
}),

activeLinks: function() {
activeLinks: Ember.computed('indexLinks', function() {
let activeLinks = [];
let indexLinks = this.get('indexLinks');
indexLinks.forEach(function(link) {
Expand All @@ -33,6 +33,6 @@ export default Ember.Controller.extend(UserSession, {
}
}.bind(this));
return activeLinks;
}.property('indexLinks')
})

});

0 comments on commit ba6c524

Please sign in to comment.