gitlab-org--gitlab-foss/app/helpers/compare_helper.rb
2013-09-12 21:39:53 +03:00

13 lines
436 B
Ruby

module CompareHelper
def compare_to_mr_button?
params[:from].present? && params[:to].present? &&
@repository.branch_names.include?(params[:from]) &&
@repository.branch_names.include?(params[:to]) &&
params[:from] != params[:to] &&
!@refs_are_same
end
def compare_mr_path
new_project_merge_request_path(@project, merge_request: {source_branch: params[:to], target_branch: params[:from]})
end
end