Fixed: copied private queries not visible after project copy (#9520).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7782 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-11-11 17:33:02 +00:00
parent c63ab52201
commit 3da92d7da7
2 changed files with 2 additions and 0 deletions

View File

@ -810,6 +810,7 @@ class Project < ActiveRecord::Base
new_query.attributes = query.attributes.dup.except("id", "project_id", "sort_criteria")
new_query.sort_criteria = query.sort_criteria if query.sort_criteria
new_query.project = self
new_query.user_id = query.user_id
self.queries << new_query
end
end

View File

@ -897,6 +897,7 @@ class ProjectTest < ActiveSupport::TestCase
assert query
assert_equal @project, query.project
end
assert_equal @source_project.queries.map(&:user_id).sort, @project.queries.map(&:user_id).sort
end
should "copy versions" do