summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2019-02-20 13:04:41 +0100
committerMatija Čupić <matteeyah@gmail.com>2019-02-20 15:10:10 +0100
commitbb4076de4592f1246a38441367ac14e19bb368d3 (patch)
tree9dd2be0ff7fd68019a97e34ba8ef9f8a1d1ab022
parent094d740886eaf62fd219dacd11aa9a966758a962 (diff)
downloadgitlab-ce-bb4076de4592f1246a38441367ac14e19bb368d3.tar.gz
Delegate last_pipeline to Project
-rw-r--r--app/models/project.rb1
-rw-r--r--spec/models/project_spec.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index c72d3a3b725..b81a156c436 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 1f9088c2e6b..473bef0bb83 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -458,6 +458,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