fix copying of a wiki. self.wiki = Wiki.new immediately tries to save to the database. unfortunately, a Wiki.new is not valid? it misses the :start_page

pull/1186/head
Martin Linkhorst 12 years ago
parent 47e7e7997d
commit f57184ecda
  1. 3
      app/models/project.rb

@ -677,8 +677,7 @@ class Project < ActiveRecord::Base
def copy_wiki(project)
# Check that the source project has a wiki first
unless project.wiki.nil?
self.wiki ||= Wiki.new
wiki.attributes = project.wiki.attributes.dup.except("id", "project_id")
self.wiki = self.build_wiki(project.wiki.attributes.dup.except("id", "project_id"))
wiki_pages_map = {}
project.wiki.pages.each do |page|
# Skip pages without content

Loading…
Cancel
Save