Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
474de8872e6a
Commit
926f3013
authored
Dec 12, 2011
by
Jeremy Mack
Browse files
Updated validations and routes to support dots in project names
parent
4d65160317ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
474de887
...
...
@@ -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
}
...
...
config/routes.rb
View file @
474de887
...
...
@@ -6,7 +6,7 @@
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 @@
#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"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment