Story#113524121 - change validation that legal document body is not valid only if path is not set

This commit is contained in:
Vladimir Krylov 2016-03-04 14:33:06 +02:00
parent 625b303ed6
commit 6f4ff0fd46

View file

@ -9,7 +9,8 @@ class LegalDocument < ActiveRecord::Base
belongs_to :documentable, polymorphic: true
validates :body, length: { minimum: (1.37 * 1.4).ceil }
validates :body, length: { minimum: (1.37 * 1.4).ceil }, unless: :path
before_create :add_creator
before_save :save_to_filesystem