gitlab-org--gitlab-foss/app/helpers/compare_helper.rb

23 lines
561 B
Ruby
Raw Normal View History

module CompareHelper
def compare_to_mr_button?
@project.merge_requests_enabled &&
params[:from].present? &&
params[:to].present? &&
@repository.branch_names.include?(params[:from]) &&
@repository.branch_names.include?(params[:to]) &&
2013-09-12 14:39:27 -04:00
params[:from] != params[:to] &&
!@refs_are_same
end
def compare_mr_path
new_namespace_project_merge_request_path(
@project.namespace,
@project,
merge_request: {
source_branch: params[:to],
target_branch: params[:from]
}
)
end
end