fix UrlGenerationError: No route matches

This commit is contained in:
Alexander Machehin 2014-10-11 12:07:57 +06:00
parent 7a151b4fc8
commit c9bda80cbb
2 changed files with 3 additions and 1 deletions

View File

@ -180,6 +180,7 @@ class PullRequest < ActiveRecord::Base
end
def clone
return if from_project.nil?
git = Grit::Git.new(path)
if new_record? || !git.exist?
#~ FileUtils.mkdir_p(path)

View File

@ -3,7 +3,8 @@
%a{name: "diff-#{pull_diff_counter}"}
.top
.l= h(pull_diff.renamed_file ? "#{pull_diff.a_path.rtruncate 60}=>#{pull_diff.b_path.rtruncate 60}" : pull_diff.b_path.rtruncate(120))
.r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@pull.from_project, commit_id, pull_diff.b_path)
- if @pull.from_project.present?
.r= link_to "view file @ #{short_hash_id(commit_id)}", blob_path(@pull.from_project, commit_id, pull_diff.b_path)
.clear
-if pull_diff.diff.present? && !(@pull.repo.tree(commit_id) / pull_diff.b_path).binary?
.diff_data=render_diff(pull_diff, diff_counter: pull_diff_counter, comments: @comments)