summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/deployments.rb4
-rw-r--r--lib/gitlab/cycle_analytics/summary/deploy.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb
index 6747e2e5005..2fb8551543a 100644
--- a/lib/api/deployments.rb
+++ b/lib/api/deployments.rb
@@ -24,7 +24,7 @@ module API
get ':id/deployments' do
authorize! :read_deployment, user_project
- present paginate(user_project.deployments.order(params[:order_by] => params[:sort])), with: Entities::Deployment
+ present paginate(user_project.deployments.deployed.order(params[:order_by] => params[:sort])), with: Entities::Deployment
end
# rubocop: enable CodeReuse/ActiveRecord
@@ -38,7 +38,7 @@ module API
get ':id/deployments/:deployment_id' do
authorize! :read_deployment, user_project
- deployment = user_project.deployments.find(params[:deployment_id])
+ deployment = user_project.deployments.deployed.find(params[:deployment_id])
present deployment, with: Entities::Deployment
end
diff --git a/lib/gitlab/cycle_analytics/summary/deploy.rb b/lib/gitlab/cycle_analytics/summary/deploy.rb
index 39fdf5074da..b1c644f77f3 100644
--- a/lib/gitlab/cycle_analytics/summary/deploy.rb
+++ b/lib/gitlab/cycle_analytics/summary/deploy.rb
@@ -7,7 +7,7 @@ module Gitlab
end
def value
- @value ||= @project.deployments.success.where("created_at > ?", @from).count
+ @value ||= @project.deployments.deployed.where("finished_at > ?", @from).count
end
end
end