diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 20:23:48 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-12-02 20:23:48 +0000 |
commit | 536747b74708188848d85d8de5df34e7aa762006 (patch) | |
tree | c7cfe03314c047dff313825c8548d056e5e1af29 /app/models/repository | |
parent | 96fca0b08f6d60e8736e8e3f95a5d0ae33779068 (diff) | |
download | redmine-536747b74708188848d85d8de5df34e7aa762006.tar.gz redmine-536747b74708188848d85d8de5df34e7aa762006.zip |
Replaces find(:all) calls.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10917 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository')
-rw-r--r-- | app/models/repository/mercurial.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/repository/mercurial.rb b/app/models/repository/mercurial.rb index 54262d9a6..ac10e064c 100644 --- a/app/models/repository/mercurial.rb +++ b/app/models/repository/mercurial.rb @@ -92,11 +92,12 @@ class Repository::Mercurial < Repository # Sqlite3 and PostgreSQL pass. # Is this MySQL bug? def latest_changesets(path, rev, limit=10) - changesets.find(:all, - :include => :user, - :conditions => latest_changesets_cond(path, rev, limit), - :limit => limit, - :order => "#{Changeset.table_name}.id DESC") + changesets. + includes(:user). + where(latest_changesets_cond(path, rev, limit)). + limit(limit). + order("#{Changeset.table_name}.id DESC"). + all end def latest_changesets_cond(path, rev, limit) |