travis-web/assets/scripts/app/models/branch.coffee
Piotr Sarnacki c7561ee13e Properly display matrix keys when build does not have all keys
When additional items are included into matrix via 'matrix.include' key
in .travis.yml they may contain config keys, which are not available on
build.

For example build can contain only 'rvm' key, but we may add the
following include:

    matrix:
      include:
        - rvm: '2.0.0'
          env: 'FOO=bar'

In such case, we need to take into account also keys from additional
job, not only from the build.

(closes #172)
2013-04-06 01:48:32 +02:00

28 lines
729 B
CoffeeScript

require 'travis/model'
@Travis.Branch = Travis.Model.extend
repoId: DS.attr('number', key: 'repository_id')
commitId: DS.attr('number')
state: DS.attr('string')
number: DS.attr('number')
branch: DS.attr('string')
message: DS.attr('string')
result: DS.attr('number')
duration: DS.attr('number')
startedAt: DS.attr('string')
finishedAt: DS.attr('string')
commit: DS.belongsTo('Travis.Commit')
repo: (->
Travis.Repo.find @get('repoId') if @get('repoId')
).property('repoId')
updateTimes: ->
@notifyPropertyChange 'started_at'
@notifyPropertyChange 'finished_at'
@Travis.Branch.reopenClass
byRepoId: (id) ->
@find repository_id: id