]> source.dussan.org Git - redmine.git/commitdiff
Allow non-unique names for projects (#630).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 11 Nov 2010 13:39:14 +0000 (13:39 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 11 Nov 2010 13:39:14 +0000 (13:39 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4391 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index cdc8414ff52a97e9e885791e26113bd28d6fb9bb..21eff8ca7c1104c901baac3d7143ac209509c2fe 100644 (file)
@@ -524,7 +524,7 @@ module ApplicationHelper
       esc, all, page, title = $1, $2, $3, $5
       if esc.nil?
         if page =~ /^([^\:]+)\:(.*)$/
-          link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
+          link_project = Project.find_by_identifier($1) || Project.find_by_name($1)
           page = $2
           title ||= $1 if page.blank?
         end
index a6d7dc790e4c8e29098c165441cacc86aeb85664..43e0ce8dc77ca7fe5a65153bcf3bb41741e791f6 100644 (file)
@@ -64,7 +64,7 @@ class Project < ActiveRecord::Base
   attr_protected :status, :enabled_module_names
   
   validates_presence_of :name, :identifier
-  validates_uniqueness_of :name, :identifier
+  validates_uniqueness_of :identifier
   validates_associated :repository, :wiki
   validates_length_of :name, :maximum => 30
   validates_length_of :homepage, :maximum => 255
index e4927eba1e1b558389111b6a78f8d1fb077d1ad4..d57813ae4b2089ac2dc080f37cdbdac4d4be6989 100644 (file)
@@ -29,7 +29,6 @@ class ProjectTest < ActiveSupport::TestCase
   should_validate_presence_of :name
   should_validate_presence_of :identifier
 
-  should_validate_uniqueness_of :name
   should_validate_uniqueness_of :identifier
 
   context "associations" do