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:
commit
e488f52ca0
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue