diff --git a/assets/scripts/app/models/hook.coffee b/assets/scripts/app/models/hook.coffee index f35166ac..58fff636 100644 --- a/assets/scripts/app/models/hook.coffee +++ b/assets/scripts/app/models/hook.coffee @@ -27,3 +27,13 @@ require 'travis/model' return if @get('isSaving') @set 'active', !@get('active') @save() + + repo: (-> + # I don't want to make an ajax request for each repository showed in profile, + # especially, because most of them does not have any builds anyway. That's why + # I add an info which we have here to the store - this will allow to display + # a link to the repo and if more info is needed, it will be requested when the + # link is used + Travis.loadOrMerge(Travis.Repo, @getProperties('id', 'slug', 'name', 'ownerName'), skipIfExists: true) + Travis.Repo.find(@get('id')) + ).property('id') diff --git a/assets/scripts/app/templates/profile/tabs/hooks.hbs b/assets/scripts/app/templates/profile/tabs/hooks.hbs index dc920183..0cae8362 100644 --- a/assets/scripts/app/templates/profile/tabs/hooks.hbs +++ b/assets/scripts/app/templates/profile/tabs/hooks.hbs @@ -23,7 +23,7 @@
{{hook.description}}