summaryrefslogtreecommitdiffstats
path: root/models/repo_unit.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-05-18 22:54:24 +0800
committerGitHub <noreply@github.com>2017-05-18 22:54:24 +0800
commitfd6034aaf23af1ce03bcba0babcbe7675ce093ee (patch)
tree9720f416facdef02a76bd56ca50669cc1f17eb88 /models/repo_unit.go
parent5db5e16ab61f25f21cb17ee4895679b9830641a5 (diff)
downloadgitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.tar.gz
gitea-fd6034aaf23af1ce03bcba0babcbe7675ce093ee.zip
Add units to team (#947)
* add units to team * fix lint * finish team setting backend * finished permission controll on routes * fix import blank line * add unit check on ssh/http pull and push and fix test failed * fix fixtures data * remove unused code
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r--models/repo_unit.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go
index ee61ef4c9d..f8f01c4398 100644
--- a/models/repo_unit.go
+++ b/models/repo_unit.go
@@ -135,3 +135,11 @@ func (r *RepoUnit) ExternalWikiConfig() *ExternalWikiConfig {
func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig {
return r.Config.(*ExternalTrackerConfig)
}
+
+func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) {
+ return units, e.Where("repo_id = ?", repoID).Find(&units)
+}
+
+func getUnitsByRepoIDAndIDs(e Engine, repoID int64, types []UnitType) (units []*RepoUnit, err error) {
+ return units, e.Where("repo_id = ?", repoID).In("`type`", types).Find(&units)
+}