fix #140, commit lil refactor
This commit is contained in:
parent
29e11d1461
commit
1a9531c9a4
5 changed files with 59 additions and 38 deletions
|
@ -36,6 +36,8 @@ class Project < ActiveRecord::Base
|
|||
|
||||
validate :check_limit
|
||||
|
||||
validate :repo_name
|
||||
|
||||
after_destroy :destroy_gitosis_project
|
||||
after_save :update_gitosis_project
|
||||
|
||||
|
@ -168,6 +170,12 @@ class Project < ActiveRecord::Base
|
|||
errors[:base] << ("Cant check your ability to create project")
|
||||
end
|
||||
|
||||
def repo_name
|
||||
if path == "gitosis-admin"
|
||||
errors.add(:path, "Project path like 'gitosis-admin' is not allowed")
|
||||
end
|
||||
end
|
||||
|
||||
def valid_repo?
|
||||
repo
|
||||
rescue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue