Fix Note validation

* remove length restriction on note
* add format validation for line_code
This commit is contained in:
Riyad Preukschas 2012-11-20 23:57:01 +01:00
parent 654f10102e
commit e8f10f317f

View file

@ -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