diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-25 12:10:57 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-25 12:10:57 +0000 |
commit | 555d2bf67f2bd40169330b1fa016877c465df020 (patch) | |
tree | 291f051ef357bc07a7c6d5a80532fef9667c8ab9 | |
parent | 51c919a29a2b8f66b99dcdba6b3eb4af3389a222 (diff) | |
parent | bb4076de4592f1246a38441367ac14e19bb368d3 (diff) | |
download | gitlab-ce-555d2bf67f2bd40169330b1fa016877c465df020.tar.gz |
Merge branch '7861-cross-project-pipeline-dashboard-mvc-2-ce' into 'master'
Delegate last_pipeline to Project
See merge request gitlab-org/gitlab-ce!25422
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 9c3dbf63867..83f8d004a46 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -305,6 +305,7 @@ class Project < ActiveRecord::Base delegate :group_runners_enabled, :group_runners_enabled=, :group_runners_enabled?, to: :ci_cd_settings delegate :group_clusters_enabled?, to: :group, allow_nil: true delegate :root_ancestor, to: :namespace, allow_nil: true + delegate :last_pipeline, to: :commit, allow_nil: true # Validations validates :creator, presence: true, on: :create diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index a78647cb89a..bcbe687f4a2 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -482,6 +482,7 @@ describe Project do it { is_expected.to delegate_method(:name).to(:owner).with_prefix(true).with_arguments(allow_nil: true) } it { is_expected.to delegate_method(:group_clusters_enabled?).to(:group).with_arguments(allow_nil: true) } it { is_expected.to delegate_method(:root_ancestor).to(:namespace).with_arguments(allow_nil: true) } + it { is_expected.to delegate_method(:last_pipeline).to(:commit).with_arguments(allow_nil: true) } end describe '#to_reference_with_postfix' do |