summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2018-01-09 13:20:32 +1100
committerSimon Knox <psimyn@gmail.com>2018-01-09 13:20:32 +1100
commit729e08a665fb8aab7d0ac357df556a3436e4f327 (patch)
tree231b16ca2fa02f2a1af899a63eef046c2040199e
parent2fc6b1ee4c4283b2e3bf49835ec5369dd8f9a3eb (diff)
downloadgitlab-ce-729e08a665fb8aab7d0ac357df556a3436e4f327.tar.gz
fix static analysis task
-rw-r--r--app/serializers/diff_file_entity.rb4
-rw-r--r--app/serializers/discussion_entity.rb10
2 files changed, 7 insertions, 7 deletions
diff --git a/app/serializers/diff_file_entity.rb b/app/serializers/diff_file_entity.rb
index e2f4338e081..5667ea6408e 100644
--- a/app/serializers/diff_file_entity.rb
+++ b/app/serializers/diff_file_entity.rb
@@ -31,7 +31,7 @@ class DiffFileEntity < Grape::Entity
expose :text?, as: :text
expose :old_path_html do |diff_file|
- old_path, _ = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
+ old_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
old_path
end
@@ -39,4 +39,4 @@ class DiffFileEntity < Grape::Entity
_, new_path = mark_inline_diffs(diff_file.old_path, diff_file.new_path)
new_path
end
-end \ No newline at end of file
+end
diff --git a/app/serializers/discussion_entity.rb b/app/serializers/discussion_entity.rb
index 8637861849a..bbbcf6a97c1 100644
--- a/app/serializers/discussion_entity.rb
+++ b/app/serializers/discussion_entity.rb
@@ -26,8 +26,8 @@ class DiscussionEntity < Grape::Entity
collection: discussion.truncated_diff_lines,
as: :line,
locals: { diff_file: discussion.diff_file,
- discussion_expanded: true,
- plain: true },
+ discussion_expanded: true,
+ plain: true },
layout: false,
formats: [:html]
)
@@ -35,12 +35,12 @@ class DiscussionEntity < Grape::Entity
expose :image_diff_html, if: -> (d, _) { defined? d.diff_file } do |discussion|
diff_file = discussion.diff_file
- partial = (diff_file.new_file? || diff_file.deleted_file?) ? 'single_image_diff' : 'replaced_image_diff'
+ partial = diff_file.new_file? || diff_file.deleted_file? ? 'single_image_diff' : 'replaced_image_diff'
options[:context].render_to_string(
partial: "projects/diffs/#{partial}",
locals: { diff_file: diff_file,
- position: discussion.position.to_json,
- click_to_comment: false },
+ position: discussion.position.to_json,
+ click_to_comment: false },
layout: false,
formats: [:html]
)