@@ -1,5 +1,5 | |||||
1 |
# |
|
1 | # Redmine - project management software | |
2 |
# Copyright (C) 2006-20 |
|
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
@@ -146,14 +146,19 class Repository < ActiveRecord::Base | |||||
146 | # Default behaviour is to search in cached changesets |
|
146 | # Default behaviour is to search in cached changesets | |
147 | def latest_changesets(path, rev, limit=10) |
|
147 | def latest_changesets(path, rev, limit=10) | |
148 | if path.blank? |
|
148 | if path.blank? | |
149 |
changesets.find( |
|
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 | else |
|
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 | end |
|
162 | end | |
158 | end |
|
163 | end | |
159 |
|
164 |
General Comments 0
You need to be logged in to leave comments.
Login now