Browse Source

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
tags/1.3.0
Jean-Philippe Lang 12 years ago
parent
commit
3da92d7da7
2 changed files with 2 additions and 0 deletions
  1. 1
    0
      app/models/project.rb
  2. 1
    0
      test/unit/project_test.rb

+ 1
- 0
app/models/project.rb 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

+ 1
- 0
test/unit/project_test.rb 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

Loading…
Cancel
Save