{"action":"opened","issue":{"url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/258","repository_url":"https://api.github.com/repos/code-corps/code-corps-ember","labels_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/258/comments","events_url":"https://api.github.com/repos/code-corps/code-corps-ember/issues/258/events","html_url":"https://github.com/code-corps/code-corps-ember/issues/258","id":162022208,"number":258,"title":"In app/routes/organizations/slugged-route.js, we're setting the organization twice.","user":{"login":"begedin","id":1925540,"avatar_url":"https://avatars.githubusercontent.com/u/1925540?v=3","gravatar_id":"","url":"https://api.github.com/users/begedin","html_url":"https://github.com/begedin","followers_url":"https://api.github.com/users/begedin/followers","following_url":"https://api.github.com/users/begedin/following{/other_user}","gists_url":"https://api.github.com/users/begedin/gists{/gist_id}","starred_url":"https://api.github.com/users/begedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begedin/subscriptions","organizations_url":"https://api.github.com/users/begedin/orgs","repos_url":"https://api.github.com/users/begedin/repos","events_url":"https://api.github.com/users/begedin/events{/privacy}","received_events_url":"https://api.github.com/users/begedin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/code-corps/code-corps-ember/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-23T21:01:12Z","updated_at":"2016-06-23T21:01:12Z","closed_at":null,"body":"In the [`sluged-route` `model` and `beforeModel` hooks](https://github.com/code-corps/code-corps-ember/blob/develop/app/routes/organizations/slugged-route.js), we're setting the organization, for the `credentials` service, twice:\r\n\r\n```Javascript\r\n  model(params) {\r\n    return this.store.queryRecord('slugged-route', {\r\n      slug: params.slugged_route_slug\r\n    }).then((result) => {\r\n      let organization = result.get('owner');\r\n      return this.get('credentials').setOrganization(organization).then(() => {\r\n        return organization;\r\n      });\r\n    });\r\n  },\r\n\r\n  afterModel(organization) {\r\n    this.get('credentials').setOrganization(organization);\r\n    return this._super(...arguments);\r\n  },\r\n```\r\n\r\nThis probably doesn't cause problems, but is unnecessary, probably causes a very slight performance impact and can be confusing. "}}
{"actor":{"display_login":"begedin"}}