add eventType as an attribute, include api builds to the history
This commit is contained in:
parent
2751d8878e
commit
5e1dd9a83b
|
@ -17,6 +17,7 @@ Build = Model.extend DurationCalculations,
|
||||||
pullRequest: DS.attr('boolean')
|
pullRequest: DS.attr('boolean')
|
||||||
pullRequestTitle: DS.attr()
|
pullRequestTitle: DS.attr()
|
||||||
pullRequestNumber: DS.attr('number')
|
pullRequestNumber: DS.attr('number')
|
||||||
|
eventType: DS.attr('string')
|
||||||
|
|
||||||
repo: DS.belongsTo('repo', async: true)
|
repo: DS.belongsTo('repo', async: true)
|
||||||
commit: DS.belongsTo('commit', async: true)
|
commit: DS.belongsTo('commit', async: true)
|
||||||
|
@ -33,11 +34,6 @@ Build = Model.extend DurationCalculations,
|
||||||
@reload()
|
@reload()
|
||||||
).property('_config')
|
).property('_config')
|
||||||
|
|
||||||
# TODO add eventType to the api for api build requests
|
|
||||||
eventType: (->
|
|
||||||
if @get('pullRequest') then 'pull_request' else 'push'
|
|
||||||
).property('pullRequest')
|
|
||||||
|
|
||||||
isPullRequest: (->
|
isPullRequest: (->
|
||||||
@get('eventType') == 'pull_request' || @get('pullRequest')
|
@get('eventType') == 'pull_request' || @get('pullRequest')
|
||||||
).property('eventType')
|
).property('eventType')
|
||||||
|
|
|
@ -50,8 +50,8 @@ Repo = Model.extend
|
||||||
|
|
||||||
builds: (->
|
builds: (->
|
||||||
id = @get('id')
|
id = @get('id')
|
||||||
builds = @store.filter('build', event_type: 'push', repository_id: id, (b) ->
|
builds = @store.filter('build', event_type: ['push', 'api'], repository_id: id, (b) ->
|
||||||
b.get('repo.id') == id && b.get('eventType') == 'push'
|
b.get('repo.id') == id && (b.get('eventType') == 'push' || b.get('eventType') == 'api')
|
||||||
)
|
)
|
||||||
|
|
||||||
# TODO: move to controller
|
# TODO: move to controller
|
||||||
|
|
Loading…
Reference in New Issue
Block a user