From e8f10f317faca1c87ad6529e3661afa788cb7896 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Tue, 20 Nov 2012 23:57:01 +0100 Subject: Fix Note validation * remove length restriction on note * add format validation for line_code --- app/models/note.rb | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.1