]> source.dussan.org Git - redmine.git/commitdiff
Fixed: copied private queries not visible after project copy (#9520).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 11 Nov 2011 17:33:02 +0000 (17:33 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 11 Nov 2011 17:33:02 +0000 (17:33 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7782 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb
test/unit/project_test.rb

index a2626f130f41ae123afa09b9cfeb7274e8e49172..dcfe8fdbb5c7454a378b35be0e0ef3923cdaed01 100644 (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
index 20f34e266ab7772a79bb857280b5ceddeec0f4e4..babc2e2ed6d7449ff202abd0ac77aecbba276d5a 100644 (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