diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index e8493cb3b..702ccc07c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -25,12 +25,14 @@ class Project < ActiveRecord::Base has_many :documents, :dependent => true
has_many :news, :dependent => true, :include => :author
has_many :issue_categories, :dependent => true, :order => "issue_categories.name"
+ has_one :repository, :dependent => true
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => 'custom_fields_projects', :association_foreign_key => 'custom_field_id'
acts_as_tree :order => "name", :counter_cache => true
validates_presence_of :name, :description
validates_uniqueness_of :name
validates_associated :custom_values, :on => :update
+ validates_associated :repository
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
# returns 5 last created projects
|