Skip to content
Snippets Groups Projects
Unverified Commit b04edc22 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

hotfix where about is nil

parent 091f0dbd
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,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 block.title.present? && !block.call_to_action? # call to actions keep their title
heading = object.headings.create(university: object.university)
heading.title = block.title
heading.position = heading_position
......@@ -51,8 +51,8 @@ class ContentMigration
def migrate_objects(about_type)
about_ids(about_type).each do |about_id|
object = about_type.constantize.find(about_id)
migrate(object) if object.university == @university
object = about_type.constantize.find_by(id: about_id)
migrate(object) if object.present? && object.university == @university
end
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