simplify fargets_for_select
This commit is contained in:
parent
dfd63d4f75
commit
3fc3bb6d54
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue