diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2017-04-26 12:04:22 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-26 12:04:22 +0000 |
commit | 019b06b9d29162356a89be46f958a8c0cbd022fd (patch) | |
tree | 59470748a7ccde2aceec632b9af8c4500ac973fd /app/models/project.rb | |
parent | 93a698f9b25baa1d3a66326f3f9761103c5ffb87 (diff) | |
download | gitlab-ce-019b06b9d29162356a89be46f958a8c0cbd022fd.tar.gz |
Load a project's CI status in batch from redis
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 73593f04283..c7dc562c238 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -74,6 +74,7 @@ class Project < ActiveRecord::Base attr_accessor :new_default_branch attr_accessor :old_path_with_namespace + attr_writer :pipeline_status alias_attribute :title, :name @@ -1181,6 +1182,7 @@ class Project < ActiveRecord::Base end end + # Lazy loading of the `pipeline_status` attribute def pipeline_status @pipeline_status ||= Gitlab::Cache::Ci::ProjectPipelineStatus.load_for_project(self) end |