From 99ef3a84b558e7b51bce7cbb11a6e235a6cc310b Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Fri, 29 Apr 2016 12:16:18 +0200 Subject: Validate presence of noteable_type in note model --- app/models/note.rb | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.1