From d94816ec8f36709130d891a010c1ac1480ede864 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 5 Aug 2013 13:14:58 +0200 Subject: [PATCH] Remove unneeded code This piece of code was used in order to load repos associated to jobs when the latter were loaded from pusher. This was needed because jobs events do not have repository record passed in pusher payload, so when job was added with pusher and link to the job was displayed in "Running Jobs" or in workers on right sidebar, Ember was loading missing repos. We don't need this code anymore as there is no right sidebar. Additionally after changes in Ember.js, it's possible to pass primitives to linkTo. Previously the link to record needed to be constructed as following: {{#linkTo "job" job.repo job}}Link to repo{{/linkTo}} The drawback of such code is that repo would have been instantiated in such case. Now, we can do something like this: {{#linkTo "job" job.repositorySlug job}}Link to repo{{/linkTo}} so as long as we have information about repository slug in the job data, such hacks are not be needed. --- assets/scripts/app/models/job.coffee | 8 -------- 1 file changed, 8 deletions(-) diff --git a/assets/scripts/app/models/job.coffee b/assets/scripts/app/models/job.coffee index d9a6a666..28f33edf 100644 --- a/assets/scripts/app/models/job.coffee +++ b/assets/scripts/app/models/job.coffee @@ -20,14 +20,6 @@ require 'travis/model' _config: Ember.attr('object', key: 'config') - repoSlugDidChange: (-> - if slug = @get('repoSlug') - Travis.Repo.load([{ - id: @get('repoId'), - slug: slug - }]) - ).observes('repoSlug') - log: ( -> @set('isLogAccessed', true) Travis.Log.create(job: this)