Skip to content

Commit

Permalink
Update worker.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
akabishau committed Jun 13, 2024
1 parent 8636ef8 commit 83a8fe9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/models/study_json_record/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,12 @@ def flatten(path, data, parent=nil)
result = data.map do |item|
children = item.delete(child_key.to_s)
if children.nil? || children.empty?
# nil
append_parent(item, parent) if parent
item
nil
else
res = flatten(path[1..-1], children, item)
if res.first.nil?
byebug
end
# if res.first.nil?
# byebug
# end
append_parent(res.first, parent) if parent
res
end
Expand Down

0 comments on commit 83a8fe9

Please sign in to comment.