no need to save to filesystem if no body

This commit is contained in:
Vladimir Krylov 2016-12-14 16:40:04 +02:00
parent 5eb456a210
commit 01a352e437

View file

@ -17,7 +17,7 @@ class LegalDocument < ActiveRecord::Base
validate :val_body_length, if: ->(file){ file.path.blank? && !Rails.env.staging?}
before_create :add_creator
before_save :save_to_filesystem
before_save :save_to_filesystem, if: :body
def epp_code_map
{