Skip to content
Snippets Groups Projects
Commit 40f84126 authored by pabois's avatar pabois
Browse files

correct order for duplication

parent 4ad667ef
No related branches found
No related tags found
No related merge requests found
......@@ -141,8 +141,8 @@ class Communication::Block < ApplicationRecord
translation.about = about_translation
translation.template.translate!
translation.data = translation.template.data
translation.heading_id = heading_id
translation.save
translation.heading_id = heading_id
end
def to_s
......@@ -172,7 +172,7 @@ class Communication::Block < ApplicationRecord
def set_heading_from_about
# IMPROVEMENT: Ne gère que le 1er niveau actuellement
self.heading = about.headings.root.ordered.last
self.heading ||= about.headings.root.ordered.last
end
# FIXME @sebou
......
......@@ -82,13 +82,13 @@ module WithTranslations
end
def translate_contents!(translation)
headings.root.ordered.each do |heading|
heading.translate!(translation)
end
blocks.without_heading.ordered.each do |block|
block.translate!(translation)
end
headings.root.ordered.each do |heading|
heading.translate!(translation)
end
end
# Utility method to duplicate attachments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment