Skip to content

Commit

Permalink
Fix level not being printed on option row
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Jan 11, 2024
1 parent 37abc12 commit 5ee1a18
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/models/forms/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,12 @@ def options_to_xls(option_sets)
os.option_nodes.each do |node|
# do we have levels?
level_to_push = ""
if node.level.present? && node.children.present?
# Q: will this work if there is more than one cascading level?
# e.g., country -> state -> city
level_to_push = node.parent.name
if node.level.present?
if node.ancestry_depth > 1
# Q: will this work if there is more than one cascading level?
# e.g., country -> state -> city
level_to_push = node.parent.name
end
end

if node.option.present? # rubocop:disable Style/Next
Expand Down

0 comments on commit 5ee1a18

Please sign in to comment.