diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 22:21:40 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-09-15 22:21:46 +0300 |
commit | 5285e01d54cff68db99aaa4b15a87d8d4c0333ab (patch) | |
tree | e4a97185bb9687bffe5a22afb1677b992a8c540f /app/models | |
parent | 9621f433a7ba7b1f4083c27aac1b41642f82f352 (diff) |
Fix: features/ci/runners_spec.rb
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/user.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index bff8eeed96d..25371f9138a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -753,4 +753,13 @@ class User < ActiveRecord::Base def can_be_removed? !solo_owned_groups.present? end + + def ci_authorized_projects + @ci_authorized_projects ||= Ci::Project.where(gitlab_id: authorized_projects) + end + + def ci_authorized_runners + Ci::Runner.specific.includes(:runner_projects). + where(ci_runner_projects: { project_id: ci_authorized_projects } ) + end end |