diff --git a/app/models/manuscript.rb b/app/models/manuscript.rb index ee34b6e7b..3316d5fb7 100644 --- a/app/models/manuscript.rb +++ b/app/models/manuscript.rb @@ -417,10 +417,9 @@ def new_chapters # sections in a manuscript chapter not represented in mampf def new_sections_in_chapter(chapter) sections = sections_in_chapter(chapter) - sections.each_with_index - .map do |s, i| - [s["mampf_section"], i + 1, s["description"], s["counter"]] - end + sections = sections.each_with_index.map do |s, i| + [s["mampf_section"], i + 1, s["description"], s["counter"]] + end sections.select { |s| s.first.nil? } .map { |s| [s.second, s.third, s.fourth] } end