no validation for old procedures

This commit is contained in:
Christophe Robillard 2021-03-04 16:13:19 +01:00
parent ae8df82dbc
commit 7f496c43e5

View file

@ -202,7 +202,7 @@ class Procedure < ApplicationRecord
"image/jpg", "image/jpg",
"image/png", "image/png",
"text/plain" "text/plain"
], size: { less_than: 20.megabytes } ], size: { less_than: 20.megabytes }, if: -> { new_record? || created_at > Date.new(2020, 2, 27) }
validates :deliberation, content_type: [ validates :deliberation, content_type: [
"application/msword", "application/msword",
@ -213,9 +213,12 @@ class Procedure < ApplicationRecord
"image/jpg", "image/jpg",
"image/png", "image/png",
"text/plain" "text/plain"
], size: { less_than: 20.megabytes } ], size: { less_than: 20.megabytes }, if: -> { new_record? || created_at > Date.new(2020, 4, 29) }
validates :logo, content_type: ['image/png', 'image/jpg', 'image/jpeg'],
size: { less_than: 5.megabytes },
if: -> { new_record? || created_at > Date.new(2020, 11, 13) }
validates :logo, content_type: ['image/png', 'image/jpg', 'image/jpeg'], size: { less_than: 5.megabytes }
validates :api_entreprise_token, jwt_token: true, allow_blank: true validates :api_entreprise_token, jwt_token: true, allow_blank: true
before_save :update_juridique_required before_save :update_juridique_required