Issue #82 - Add owner to project

This commit is contained in:
Valera Sizov 2011-10-09 04:05:31 -07:00
parent 819818ad74
commit 9840102651
7 changed files with 15 additions and 3 deletions

View file

@ -4,6 +4,7 @@ class Project < ActiveRecord::Base
has_many :issues, :dependent => :destroy
has_many :users_projects, :dependent => :destroy
has_many :users, :through => :users_projects
belongs_to :owner, :class_name => "User"
has_many :notes, :dependent => :destroy
validates :name,
@ -28,7 +29,7 @@ class Project < ActiveRecord::Base
after_destroy :destroy_gitosis_project
after_save :update_gitosis_project
attr_protected :private_flag
attr_protected :private_flag, :owner_id
scope :public_only, where(:private_flag => false)
@ -44,7 +45,6 @@ class Project < ActiveRecord::Base
read_attribute(:code).downcase.strip.gsub(' ', '')
end
def update_gitosis_project
Gitosis.new.configure do |c|
c.update_project(path, gitosis_writers)
@ -145,5 +145,6 @@ end
# updated_at :datetime
# private_flag :boolean default(TRUE), not null
# code :string(255)
# owner_id :integer
#