fix #140, commit lil refactor

This commit is contained in:
gitlabhq 2011-10-21 21:40:36 +03:00
parent 29e11d1461
commit 1a9531c9a4
5 changed files with 59 additions and 38 deletions

View file

@ -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