summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Mack <jmacktdkc@gmail.com>2011-12-12 13:13:11 -0500
committerJeremy Mack <jmacktdkc@gmail.com>2011-12-12 13:13:11 -0500
commit926f3013c25645543fb1c91f7346585fdcb7a3a6 (patch)
treeccba97e138e50da72f93fc9ea051e1eb4b33fbdb
parent822c0a506043a2e5ba0a58769b398cfe91d3df47 (diff)
downloadgitlab-ce-926f3013c25645543fb1c91f7346585fdcb7a3a6.tar.gz
Updated validations and routes to support dots in project names
-rw-r--r--app/models/project.rb4
-rw-r--r--config/routes.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index a5361313911..85d5416b9ec 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -25,7 +25,7 @@ class Project < ActiveRecord::Base
validates :path,
:uniqueness => true,
:presence => true,
- :format => { :with => /^[a-zA-Z0-9_\-]*$/,
+ :format => { :with => /^[a-zA-Z0-9_\-\.]*$/,
:message => "only letters, digits & '_' '-' allowed" },
:length => { :within => 0..255 }
@@ -35,7 +35,7 @@ class Project < ActiveRecord::Base
validates :code,
:presence => true,
:uniqueness => true,
- :format => { :with => /^[a-zA-Z0-9_\-]*$/,
+ :format => { :with => /^[a-zA-Z0-9_\-\.]*$/,
:message => "only letters, digits & '_' '-' allowed" },
:length => { :within => 3..255 }
diff --git a/config/routes.rb b/config/routes.rb
index 27d0612de03..1fbbbfd536a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,7 +6,7 @@ Gitlab::Application.routes.draw do
namespace :admin do
resources :users
- resources :projects
+ resources :projects, :constraints => { :id => /[^\/]+/ }
resources :team_members
get 'emails', :to => 'mailer#preview'
get 'mailer/preview_note'
@@ -28,12 +28,12 @@ Gitlab::Application.routes.draw do
#get "profile/:id", :to => "profile#show"
- resources :projects, :only => [:new, :create, :index]
+ resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index]
resources :keys
devise_for :users
- resources :projects, :except => [:new, :create, :index], :path => "/" do
+ resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
member do
get "team"
get "wall"