add comments

This commit is contained in:
simon lehericey 2022-07-06 17:39:31 +02:00
parent 01bc7aa29e
commit 62b5bd974e

View file

@ -51,7 +51,11 @@ class TypesDeChamp::ConditionsComponent < ApplicationComponent
end
def left_operand_tag(targeted_champ, row_index)
current_target_valid = targets.map(&:second).include?(targeted_champ.to_json)
# current_target can be invalid if
# - its type has changed : number -> carto
# - it has been removed
# - it has been put lower in the form
current_target_valid = targets_for_select.map(&:second).include?(targeted_champ.to_json)
selected_target = current_target_valid ? targeted_champ.to_json : empty.to_json