76aad9b76e
Make the following changes to deal with new behavior in Rails 4.1.2: * Use nested resources to avoid slashes in arguments to path helpers.
22 lines
561 B
Ruby
22 lines
561 B
Ruby
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]) &&
|
|
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
|