Merge pull request #8391 from colinux/conditional-perf

fix: gros gain de perf sur l'affichage des dossiers avec beaucoup de conditionnel
This commit is contained in:
Colin Darie 2023-01-10 11:52:27 +01:00 committed by GitHub
commit e488f52ca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -214,7 +214,10 @@ class Champ < ApplicationRecord
end
def visible?
if conditional?
# Huge gain perf for cascade conditions
return @visible if instance_variable_defined? :@visible
@visible = if conditional?
type_de_champ.condition.compute(champs_for_condition)
else
true