##// END OF EJS Templates
scm: code clean up repository model....
Toshi MARUYAMA -
r5533:fbdbdf96fe91
parent child
Show More
@@ -1,5 +1,5
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
@@ -146,14 +146,19 class Repository < ActiveRecord::Base
146 146 # Default behaviour is to search in cached changesets
147 147 def latest_changesets(path, rev, limit=10)
148 148 if path.blank?
149 changesets.find(:all, :include => :user,
149 changesets.find(
150 :all,
151 :include => :user,
150 152 :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
151 153 :limit => limit)
152 154 else
153 changes.find(:all, :include => {:changeset => :user},
155 changes.find(
156 :all,
157 :include => {:changeset => :user},
154 158 :conditions => ["path = ?", path.with_leading_slash],
155 159 :order => "#{Changeset.table_name}.committed_on DESC, #{Changeset.table_name}.id DESC",
156 :limit => limit).collect(&:changeset)
160 :limit => limit
161 ).collect(&:changeset)
157 162 end
158 163 end
159 164
General Comments 0
You need to be logged in to leave comments. Login now