diff --git a/Gemfile.lock b/Gemfile.lock index 9088549ba..56723ccbc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -248,19 +248,25 @@ GEM execjs (2.7.0) factory_bot (6.1.0) activesupport (>= 5.0.0) - faraday (1.4.3) + faraday (1.8.0) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) faraday-net_http (~> 1.0) faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) multipart-post (>= 1.2, < 3) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) + faraday-httpclient (1.0.1) faraday-net_http (1.0.1) - faraday-net_http_persistent (1.1.0) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) ffi (1.15.4) flipper (0.20.3) flipper-active_record (0.20.3) @@ -345,7 +351,7 @@ GEM domain_name (~> 0.5) http_accept_language (2.1.1) httpclient (2.8.3) - i18n (1.8.10) + i18n (1.8.11) concurrent-ruby (~> 1.0) i18n-tasks (0.9.33) activesupport (>= 4.0.2) @@ -489,7 +495,7 @@ GEM pundit (2.1.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.5.2) + racc (1.6.0) rack (2.2.3) rack-attack (6.5.0) rack (>= 1.0, < 3) @@ -636,7 +642,7 @@ GEM ruby-saml-idp (0.3.5) ruby-vips (2.0.17) ffi (~> 1.9) - ruby2_keywords (0.0.4) + ruby2_keywords (0.0.5) ruby_parser (3.15.1) sexp_processor (~> 4.9) rubyzip (2.3.0) @@ -661,16 +667,17 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (3.0.0) - sentry-delayed_job (4.4.0) - sentry-ruby-core (~> 4.4.0.pre.beta) - sentry-rails (4.4.0) + sentry-delayed_job (4.8.1) + delayed_job (>= 4.0) + sentry-ruby-core (~> 4.8.1) + sentry-rails (4.8.1) railties (>= 5.0) - sentry-ruby-core (~> 4.4.0.pre.beta) - sentry-ruby (4.4.2) + sentry-ruby-core (~> 4.8.1) + sentry-ruby (4.8.1) concurrent-ruby (~> 1.0, >= 1.0.2) faraday (>= 1.0) - sentry-ruby-core (= 4.4.2) - sentry-ruby-core (4.4.2) + sentry-ruby-core (= 4.8.1) + sentry-ruby-core (4.8.1) concurrent-ruby faraday sexp_processor (4.15.2) @@ -767,7 +774,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.4.2) + zeitwerk (2.5.1) zip_tricks (5.6.0) zxcvbn-ruby (1.2.0) diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 93ba7e665..d687c4011 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -560,11 +560,12 @@ class Dossier < ApplicationRecord approximative_expiration_date_reference, conservation_extension, procedure.duree_conservation_dossiers_dans_ds.months - ].compact.sum - REMAINING_WEEKS_BEFORE_EXPIRATION.weeks + ].sum - REMAINING_WEEKS_BEFORE_EXPIRATION.weeks end def close_to_expiration? - return false + return false if en_instruction? + approximative_expiration_date < Time.zone.now end def expiration_date diff --git a/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake b/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake index 3129c5033..335d7fbe2 100644 --- a/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake +++ b/lib/tasks/deployment/20211110093332_set_dossiers_processed_at.rake @@ -7,7 +7,7 @@ namespace :after_party do progress = ProgressReport.new(dossiers.count) dossiers.find_each do |dossier| - if dossier.processed_at != dossier.traitement.processed_at + if dossier.read_attribute(:processed_at) != dossier.traitement.processed_at dossier.update_column(:processed_at, dossier.traitement.processed_at) end progress.inc