Use enum to the fullest with TypeDeChamp.type_champs

This commit is contained in:
gregoirenovel 2018-08-28 16:22:34 +02:00
parent 16a719922b
commit 2d3b553e4d
21 changed files with 94 additions and 94 deletions

View file

@ -19,7 +19,7 @@ class FindDubiousProceduresJob < ApplicationJob
forbidden_tdcs = TypeDeChamp
.joins(:procedure)
.where("unaccent(types_de_champ.libelle) ~* unaccent(?)", forbidden_regexp)
.where(type_champ: %w(text textarea))
.where(type_champ: [TypeDeChamp.type_champs.fetch(:text), TypeDeChamp.type_champs.fetch(:textarea)])
.where(procedures: { archived_at: nil, whitelisted_at: nil })
dubious_procedures_and_tdcs = forbidden_tdcs