Skip to content
Snippets Groups Projects
Commit 5cab78ee authored by Arnaud Levy's avatar Arnaud Levy
Browse files

[skip ci]

parent a101ca46
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ class ContentMigration
# ignore blocks already inside headings
next if block.heading.present?
# Move title from block to heading
if block.title.present? && !block.call_to_action? # call to actions keep their title
if should_add_heading?(block)
heading = object.headings.create(university: object.university)
heading.title = block.title
heading.position = heading_position
......@@ -48,6 +48,14 @@ class ContentMigration
protected
def should_add_heading?(block)
block.title.present? &&
# these blocks keep their title
!block.call_to_action? &&
!block.post? &&
!block.page?
end
def about_types
Communication::Block.distinct.pluck(:about_type).uniq
end
......
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