summaryrefslogtreecommitdiff
path: root/app/models/deployment.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 2f04d99f9f6..46409465209 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -255,10 +255,10 @@ class Deployment < ApplicationRecord
end
end
- def includes_commit?(commit)
- return false unless commit
+ def includes_commit?(ancestor_sha)
+ return false unless sha
- project.repository.ancestor?(commit.id, sha)
+ project.repository.ancestor?(ancestor_sha, sha)
end
def update_merge_request_metrics!
@@ -294,10 +294,6 @@ class Deployment < ApplicationRecord
@stop_action ||= manual_actions.find { |action| action.name == self.on_stop }
end
- def finished_at
- read_attribute(:finished_at) || legacy_finished_at
- end
-
def deployed_at
return unless success?
@@ -405,10 +401,6 @@ class Deployment < ApplicationRecord
raise ArgumentError, "The status #{status.inspect} is invalid"
end
end
-
- def legacy_finished_at
- self.created_at if success? && !read_attribute(:finished_at)
- end
end
Deployment.prepend_mod_with('Deployment')