Remove unnecessary check from environments service

This commit is contained in:
Grzegorz Bizon 2016-11-16 12:39:06 +01:00
parent 3cf516cd20
commit 5d5b80a608

View file

@ -6,7 +6,6 @@ module Ci
@ref = branch_name
return unless has_ref?
return unless has_environments?
environments.each do |environment|
next unless environment.stoppable?
@ -22,10 +21,6 @@ module Ci
@ref.present?
end
def has_environments?
environments.any?
end
def environments
@environments ||= project
.environments_recently_updated_on_branch(@ref)