chore(rubocop): fix Rails/WhereMissing

This commit is contained in:
Colin Darie 2023-04-19 12:03:08 +02:00
parent f4ad5289cd
commit 1af404c5e7
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 3 additions and 5 deletions

View file

@ -286,7 +286,7 @@ class Dossier < ApplicationRecord
order(depose_at: 'asc')
}
scope :en_cours, -> { not_archived.state_en_construction_ou_instruction }
scope :without_followers, -> { left_outer_joins(:follows).where(follows: { id: nil }) }
scope :without_followers, -> { where.missing(:follows) }
scope :with_followers, -> { left_outer_joins(:follows).where.not(follows: { id: nil }) }
scope :with_champs, -> {
includes(champs_public: [

View file

@ -3,10 +3,8 @@ namespace :hotfix do
task dossiers_attestations: :environment do
dossiers = Dossier
.joins(procedure: :attestation_template)
.left_outer_joins(:attestation)
.where(attestation_templates: { activated: true },
attestations: { id: nil },
state: "accepte")
.where.missing(:attestation)
.where(attestation_templates: { activated: true }, state: "accepte")
.where("dossiers.processed_at > '2022-01-24'")
progress = ProgressReport.new(dossiers.count)