Fix requests page

This commit is contained in:
Piotr Sarnacki 2015-02-10 09:41:57 +01:00
parent bf80fec82f
commit 86983f1e6d
3 changed files with 6 additions and 5 deletions

View File

@ -1,4 +1,4 @@
`import { formatConfig, save } from 'travis/utils/helpers'` `import { formatCommit, safe } from 'travis/utils/helpers'`
`import { githubCommit as githubCommitUrl } from 'travis/utils/urls'` `import { githubCommit as githubCommitUrl } from 'travis/utils/urls'`
helper = Ember.Handlebars.makeBoundHelper (slug, commitSha) -> helper = Ember.Handlebars.makeBoundHelper (slug, commitSha) ->

View File

@ -5,6 +5,7 @@
# the function stops being visible inside computed properties. # the function stops being visible inside computed properties.
`import { durationFrom as durationFromHelper } from 'travis/utils/helpers'` `import { durationFrom as durationFromHelper } from 'travis/utils/helpers'`
`import Build from 'travis/models/build'` `import Build from 'travis/models/build'`
Repo = Model.extend Repo = Model.extend
slug: DS.attr() slug: DS.attr()
description: DS.attr() description: DS.attr()

View File

@ -14,15 +14,15 @@ Request = Model.extend
pullRequestTitle: DS.attr() pullRequestTitle: DS.attr()
pullRequestNumber: DS.attr('number') pullRequestNumber: DS.attr('number')
repo: DS.belongsTo('repo') repo: DS.belongsTo('repo', async: true)
commit: DS.belongsTo('commit') commit: DS.belongsTo('commit', async: true)
build: DS.belongsTo('build') build: DS.belongsTo('build', async: true)
isAccepted: (-> isAccepted: (->
# For some reason some of the requests have a null result beside the fact that # For some reason some of the requests have a null result beside the fact that
# the build was created. We need to look into it, but for now we can just assume # the build was created. We need to look into it, but for now we can just assume
# that if build was created, the request was accepted # that if build was created, the request was accepted
@get('result') == 'accepted' || @get('build') @get('result') == 'accepted' || @get('build.id')
).property('result') ).property('result')
isPullRequest: (-> isPullRequest: (->