Commit 94105993 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Scope environments to project

parent 29a64950
...@@ -70,6 +70,10 @@ module GitlabRoutingHelper ...@@ -70,6 +70,10 @@ module GitlabRoutingHelper
namespace_project_runner_path(@project.namespace, @project, runner, *args) namespace_project_runner_path(@project.namespace, @project, runner, *args)
end end
def environment_path(environment, *args)
namespace_project_environment_path(environment.project.namespace, environment.project, environment, *args)
end
def issue_path(entity, *args) def issue_path(entity, *args)
namespace_project_issue_path(entity.project.namespace, entity.project, entity, *args) namespace_project_issue_path(entity.project.namespace, entity.project, entity, *args)
end end
......
...@@ -1304,7 +1304,7 @@ class Project < ActiveRecord::Base ...@@ -1304,7 +1304,7 @@ class Project < ActiveRecord::Base
environment_ids.where(ref: ref) environment_ids.where(ref: ref)
end end
Environment.where(id: environment_ids).select do |environment| environments.where(id: environment_ids).select do |environment|
environment.includes_commit?(commit) environment.includes_commit?(commit)
end end
end end
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
%span.hidden-sm %span.hidden-sm
Deployed to Deployed to
= succeed '.' do = succeed '.' do
= link_to environment.name, namespace_project_environment_path(environment.project.namespace, environment.project, environment), class: 'environment' = link_to environment.name, environment_path(environment), class: 'environment'
- external_url = environment.external_url - external_url = environment.external_url
- if external_url - if external_url
= link_to external_url, target: '_blank' do = link_to external_url, target: '_blank' do
......
...@@ -15,6 +15,8 @@ describe 'projects/merge_requests/widget/_heading' do ...@@ -15,6 +15,8 @@ describe 'projects/merge_requests/widget/_heading' do
assign(:merge_request, merge_request) assign(:merge_request, merge_request)
assign(:project, project) assign(:project, project)
allow(view).to receive(:can?).and_return(true)
render render
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment