summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-03-02 15:05:23 -0800
committerStan Hu <stanhu@gmail.com>2015-03-02 15:26:00 -0800
commitb8c9257fb1dc70cd65a14cb7dec62455ea54e394 (patch)
tree00c98ff78e7629240c9fa512325ecb0ad1845180 /app/helpers
parentf84bd771d4daa5753ad6a4b7e1a0c3cc9f51d33f (diff)
downloadgitlab-ce-b8c9257fb1dc70cd65a14cb7dec62455ea54e394.tar.gz
Fix bug where editing a comment with "+1" or "-1" would cause a server error
Closes #1151
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/notes_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/notes_helper.rb b/app/helpers/notes_helper.rb
index 92ecb2abe4d..ab44fa6ee43 100644
--- a/app/helpers/notes_helper.rb
+++ b/app/helpers/notes_helper.rb
@@ -4,9 +4,9 @@ module NotesHelper
(@noteable.class.name == note.noteable_type && !note.for_diff_line?)
end
- def note_target_fields
- hidden_field_tag(:target_type, @target_type) +
- hidden_field_tag(:target_id, @target_id)
+ def note_target_fields(note)
+ hidden_field_tag(:target_type, note.noteable.class.name.underscore) +
+ hidden_field_tag(:target_id, note.noteable.id)
end
def link_to_commit_diff_line_note(note)