summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-21 14:43:37 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-21 14:43:37 +0200
commit92984783db82e98cae06c08c680fd9c766ac52f8 (patch)
tree5d5cae41b26f000f6c420e1a4c8fb28bd61e3ab5 /app/models/commit_status.rb
parentd9a64e9f4107c68257db7dc76d25e5ecc883d7b1 (diff)
downloadgitlab-ce-fix/builds-api-nil-commit.tar.gz
Rename commit_data in Pipeline to commitfix/builds-api-nil-commit
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index bb74ff2c5f6..e437e3417a8 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -8,6 +8,8 @@ class CommitStatus < ActiveRecord::Base
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id, touch: true
belongs_to :user
+ delegate :commit, to: :pipeline
+
validates :pipeline, presence: true, unless: :importing?
validates_presence_of :name
@@ -90,12 +92,4 @@ class CommitStatus < ActiveRecord::Base
def stuck?
false
end
-
- ##
- # Deprecated, this should be removed in 9.0 in favor of exposing
- # entire pipeline in API.
- #
- def commit
- pipeline.try(:commit_data)
- end
end