Merge pull request #5957 from betagouv/fix-invalid-proc

no validation for old procedures
This commit is contained in:
krichtof 2021-03-04 16:26:31 +01:00 committed by GitHub
commit 2a5d7cf696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -202,7 +202,7 @@ class Procedure < ApplicationRecord
"image/jpg",
"image/png",
"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: [
"application/msword",
@ -213,9 +213,12 @@ class Procedure < ApplicationRecord
"image/jpg",
"image/png",
"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
before_save :update_juridique_required