scm: code clean up repository model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5653 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9c3a9fdd87
commit
fbdbdf96fe
@ -1,5 +1,5 @@
|
||||
# redMine - project management software
|
||||
# Copyright (C) 2006-2007 Jean-Philippe Lang
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@ -146,14 +146,19 @@ class Repository < ActiveRecord::Base
|
||||
# Default behaviour is to search in cached changesets
|
||||
def latest_changesets(path, rev, limit=10)
|
||||
if path.blank?
|
||||
changesets.find(:all, :include => :user,
|
||||
changesets.find(
|
||||
:all,
|
||||
:include => :user,
|
||||
:order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
|
||||
:limit => limit)
|
||||
else
|
||||
changes.find(:all, :include => {:changeset => :user},
|
||||
changes.find(
|
||||
:all,
|
||||
:include => {:changeset => :user},
|
||||
:conditions => ["path = ?", path.with_leading_slash],
|
||||
:order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
|
||||
:limit => limit).collect(&:changeset)
|
||||
:limit => limit
|
||||
).collect(&:changeset)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user