mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Story#113524121 - skip legal file body validation if path is not set or if staging
This commit is contained in:
parent
c292bc5a25
commit
07a4b1bb61
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ class LegalDocument < ActiveRecord::Base
|
||||||
belongs_to :documentable, polymorphic: true
|
belongs_to :documentable, polymorphic: true
|
||||||
|
|
||||||
|
|
||||||
validates :body, length: { minimum: (1.37 * 8.kilobytes).ceil }, unless: :path
|
validates :body, length: { minimum: (1.37 * 8.kilobytes).ceil }, if: ->(file){ file.path.blank? && !Rails.env.staging?}
|
||||||
|
|
||||||
before_create :add_creator
|
before_create :add_creator
|
||||||
before_save :save_to_filesystem
|
before_save :save_to_filesystem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue