summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-11-20 23:57:01 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-03 22:51:56 +0100
commite8f10f317faca1c87ad6529e3661afa788cb7896 (patch)
treeab245f7f5a72ba6bec1d49482455582641a8d2f8
parent654f10102e051bfcef75add025f6395da58c770d (diff)
downloadgitlab-ce-e8f10f317faca1c87ad6529e3661afa788cb7896.tar.gz
Fix Note validation
* remove length restriction on note * add format validation for line_code
-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 17b76615fa2..48916951e3b 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -32,6 +32,7 @@ class Note < ActiveRecord::Base
delegate :name, :email, to: :author, prefix: true
validates :note, :project, presence: true
+ validates :line_code, format: { with: /\A\d+_\d+_\d+\Z/ }, allow_blank: true
validates :attachment, file_size: { maximum: 10.megabytes.to_i }
mount_uploader :attachment, AttachmentUploader