def update_section_pages_and_route(blog)
      if blog.name_changed?
        old_blog_name = blog.name_was

        Cms::Section.find_by_name(old_blog_name).update_attribute(:name, blog.name)
        Cms::PageRoute.find_by_name("#{old_blog_name}: Post").update_attribute(:name, "#{blog.name}: Post")

        page = Cms::Page.find_by_name("#{old_blog_name}: Post")
        page.update_attribute(:name, "#{blog.name}: Post")
        page.publish

        page = Cms::Page.find_by_name(old_blog_name)
        page.update_attribute(:name, blog.name)
        page.publish
      end
    end
def update_section_pages_and_route(blog)
      if blog.name_changed?
        old_blog_name = blog.name_was

        Cms::Section.find_by_name(old_blog_name).update_attribute(:name, blog.name)
        Cms::PageRoute.find_by_name("#{old_blog_name}: Post").update_attribute(:name, "#{blog.name}: Post")

        page = Cms::Page.find_by_name("#{old_blog_name}: Post")
        page.update_attribute(:name, "#{blog.name}: Post")
        page.publish

        page = Cms::Page.find_by_name(old_blog_name)
        page.update_attribute(:name, blog.name)
        page.publish
      end
    end
When the name of a Blog block changes, we need to change the Post page route.
 We also change the *names* of the section and pages that hold the blog block and
 post portlet because presumably, by changing the name of the blog, the intention
 was to reflect this name change in breadcrumbs and menus.

 Note that no other routes or paths are updated. This is intentional to be consistent
 with how BrowserCMS behaves when a Section or Page names change: paths are not
 updated automatically.