Merge branch 'master' of dev.gitlabhq.com:gitlabhq

This commit is contained in:
gitlabhq 2011-11-15 04:09:13 -05:00
commit 12782adf03
66 changed files with 493 additions and 440 deletions

View file

@ -11,8 +11,8 @@ class Issue < ActiveRecord::Base
validates_presence_of :author_id
delegate :name,
:email,
:to => :author,
:email,
:to => :author,
:prefix => true
validates :title,

View file

@ -8,8 +8,8 @@ class Note < ActiveRecord::Base
:class_name => "User"
delegate :name,
:email,
:to => :author,
:email,
:to => :author,
:prefix => true
attr_protected :author, :author_id

View file

@ -129,9 +129,9 @@ class Project < ActiveRecord::Base
private_flag
end
def last_activity
def last_activity
updates(1).first
rescue
rescue
nil
end
@ -140,7 +140,7 @@ class Project < ActiveRecord::Base
end
def updates(n = 3)
[
[
fresh_commits(n),
fresh_issues(n),
fresh_notes(n)

View file

@ -9,7 +9,7 @@ class Repository
@project = project
end
def path
def path
@path ||= project.path
end

View file

@ -1,7 +1,7 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
devise :database_authenticatable, :token_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
@ -25,6 +25,8 @@ class User < ActiveRecord::Base
:foreign_key => :assignee_id,
:dependent => :destroy
before_create :ensure_authentication_token
alias_attribute :private_token, :authentication_token
scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }
def identifier