simplify fargets_for_select

This commit is contained in:
simon lehericey 2022-07-06 20:26:34 +02:00
parent dfd63d4f75
commit 3fc3bb6d54

View file

@ -69,8 +69,11 @@ class TypesDeChamp::ConditionsComponent < ApplicationComponent
end
def targets_for_select
available_targets_for_select
.then { |targets| targets.unshift([t('.select'), empty.to_json]) }
empty_target_for_select + available_targets_for_select
end
def empty_target_for_select
[[t('.select'), empty.to_json]]
end
def available_targets_for_select