Skip to content

Commit

Permalink
Merge branch 'export-custom-categories' of https://github.com/unepwcm…
Browse files Browse the repository at this point in the history
…c/ProtectedPlanet into export-custom-categories
  • Loading branch information
Levia committed Aug 18, 2020
2 parents 8a0603b + 5bd5011 commit 32d1e1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/initializers/comfy_patching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ def fragments_data(record, page_path)
end
attachment.filename
end.join("\n")
# CUSTOM CODE - adding a case for categories to manually populate the content
when "categories"
layout_category = Comfy::Cms::LayoutCategory.where(label: frag.identifier).first
record.page_categories.where(layout_category: layout_category).map do |category|
category.label
end.join(' ')
# END OF CUSTOM CODE
else
frag.content
end
Expand Down Expand Up @@ -147,7 +149,7 @@ def import_page(path, parent)
end

page.page_categories = new_categories
# CUSTOM CODE
# END OF CUSTOM CODE


page.fragments_attributes = fragments_attributes
Expand Down

0 comments on commit 32d1e1f

Please sign in to comment.