fix(champ): allow to submit when secondary options are empty
This commit is contained in:
parent
36df41c1e4
commit
e85fe71887
6 changed files with 85 additions and 53 deletions
|
@ -83,13 +83,13 @@ class Champs::LinkedDropDownListChamp < Champ
|
|||
[primary_value, secondary_value]
|
||||
end
|
||||
|
||||
def has_secondary_options_for_primary?
|
||||
primary_value.present? && secondary_options[primary_value]&.any?(&:present?)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def pack_value(primary, secondary)
|
||||
self.value = JSON.generate([primary, secondary])
|
||||
end
|
||||
|
||||
def has_secondary_options_for_primary?
|
||||
primary_value.present? && secondary_options[primary_value]&.any?(&:present?)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue