Commit 04a908f6a5c4f8753f0965615d94798286ecc675
Exists in
master
and in
4 other branches
Merge pull request #190 from mutewinter/dot_project_names
Allow dots in project names
Showing
2 changed files
with
7 additions
and
7 deletions
Show diff stats
app/models/project.rb
... | ... | @@ -25,8 +25,8 @@ class Project < ActiveRecord::Base |
25 | 25 | validates :path, |
26 | 26 | :uniqueness => true, |
27 | 27 | :presence => true, |
28 | - :format => { :with => /^[a-zA-Z0-9_\-]*$/, | |
29 | - :message => "only letters, digits & '_' '-' allowed" }, | |
28 | + :format => { :with => /^[a-zA-Z0-9_\-\.]*$/, | |
29 | + :message => "only letters, digits & '_' '-' '.' allowed" }, | |
30 | 30 | :length => { :within => 0..255 } |
31 | 31 | |
32 | 32 | validates :description, |
... | ... | @@ -35,8 +35,8 @@ class Project < ActiveRecord::Base |
35 | 35 | validates :code, |
36 | 36 | :presence => true, |
37 | 37 | :uniqueness => true, |
38 | - :format => { :with => /^[a-zA-Z0-9_\-]*$/, | |
39 | - :message => "only letters, digits & '_' '-' allowed" }, | |
38 | + :format => { :with => /^[a-zA-Z0-9_\-\.]*$/, | |
39 | + :message => "only letters, digits & '_' '-' '.' allowed" }, | |
40 | 40 | :length => { :within => 3..255 } |
41 | 41 | |
42 | 42 | validates :owner, | ... | ... |
config/routes.rb
... | ... | @@ -6,7 +6,7 @@ Gitlab::Application.routes.draw do |
6 | 6 | |
7 | 7 | namespace :admin do |
8 | 8 | resources :users |
9 | - resources :projects | |
9 | + resources :projects, :constraints => { :id => /[^\/]+/ } | |
10 | 10 | resources :team_members |
11 | 11 | get 'emails', :to => 'mailer#preview' |
12 | 12 | get 'mailer/preview_note' |
... | ... | @@ -28,12 +28,12 @@ Gitlab::Application.routes.draw do |
28 | 28 | |
29 | 29 | #get "profile/:id", :to => "profile#show" |
30 | 30 | |
31 | - resources :projects, :only => [:new, :create, :index] | |
31 | + resources :projects, :constraints => { :id => /[^\/]+/ }, :only => [:new, :create, :index] | |
32 | 32 | resources :keys |
33 | 33 | |
34 | 34 | devise_for :users |
35 | 35 | |
36 | - resources :projects, :except => [:new, :create, :index], :path => "/" do | |
36 | + resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do | |
37 | 37 | member do |
38 | 38 | get "team" |
39 | 39 | get "wall" | ... | ... |