debian-mirror-gitlab/app/controllers/concerns/diff_for_path.rb

14 lines
344 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
module DiffForPath
extend ActiveSupport::Concern
2016-09-13 17:45:13 +05:30
def render_diff_for_path(diffs)
diff_file = diffs.diff_files.find do |diff|
2017-08-17 22:00:37 +05:30
diff.file_identifier == params[:file_identifier]
2016-08-24 12:49:21 +05:30
end
return render_404 unless diff_file
2017-09-10 17:25:29 +05:30
render json: { html: view_to_html_string('projects/diffs/_content', diff_file: diff_file) }
2016-08-24 12:49:21 +05:30
end
end