diff options
author | Olivier Gonzalez <ogonzalez@gitlab.com> | 2018-11-05 18:56:52 -0500 |
---|---|---|
committer | Olivier Gonzalez <ogonzalez@gitlab.com> | 2018-11-05 18:56:52 -0500 |
commit | a89fb014a3f520d44351489bca73a42f3d4d42e8 (patch) | |
tree | 5d5274efd590da2184665e11e18e722a3026a076 /app/models/namespace.rb | |
parent | 57bc28e7907cc5166030c10638a2c756cb45dcaa (diff) | |
download | gitlab-ce-a89fb014a3f520d44351489bca73a42f3d4d42e8.tar.gz |
Backport generic methods to CEce-fix_vuln_list_on_group_dashboard
Allow to fetch all pipelines for every projects in a group and its
subgroups.
Allow to fetch the latest pipeline id for each projects of a group and
its subgroups.
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 74d48d0a9af..4a6627d3ca1 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -232,6 +232,12 @@ class Namespace < ActiveRecord::Base Project.inside_path(full_path) end + # Includes pipelines from this namespace and pipelines from all subgroups + # that belongs to this namespace + def all_pipelines + Ci::Pipeline.where(project: all_projects) + end + def has_parent? parent.present? end |