summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-29 12:16:18 +0200
committerRobert Speicher <rspeicher@gmail.com>2016-05-29 15:03:00 -0400
commit99ef3a84b558e7b51bce7cbb11a6e235a6cc310b (patch)
tree2024f829867077c68910f6a4213748c321dc97ca
parente558edd1ce47c3c056dd95c0eba8fd811ee749c7 (diff)
downloadgitlab-ce-99ef3a84b558e7b51bce7cbb11a6e235a6cc310b.tar.gz
Validate presence of noteable_type in note model
-rw-r--r--app/models/note.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index e3e522a8d0f..5f669c02e8b 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -29,6 +29,7 @@ class Note < ActiveRecord::Base
# Attachments are deprecated and are handled by Markdown uploader
validates :attachment, file_size: { maximum: :max_attachment_size }
+ validates :noteable_type, presence: true
validates :noteable_id, presence: true, unless: :for_commit?
validates :commit_id, presence: true, if: :for_commit?
validates :author, presence: true