summaryrefslogtreecommitdiffstats
path: root/app/models/repository/bazaar.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-06-12 19:13:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-06-12 19:13:25 +0000
commitf9ddb562d58ae98bcc69f74396b028cbc8cce0b1 (patch)
tree8019be9178fb3d14c764c04e3e3a5be955de1385 /app/models/repository/bazaar.rb
parent136cdc765afda57b9be02704e52b27334da42c73 (diff)
downloadredmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.tar.gz
redmine-f9ddb562d58ae98bcc69f74396b028cbc8cce0b1.zip
Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository/bazaar.rb')
-rw-r--r--app/models/repository/bazaar.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/app/models/repository/bazaar.rb b/app/models/repository/bazaar.rb
index ea20fe37d..135be83ca 100644
--- a/app/models/repository/bazaar.rb
+++ b/app/models/repository/bazaar.rb
@@ -68,15 +68,11 @@ class Repository::Bazaar < Repository
full_path = File.join(root_url, e.path)
e.size = File.stat(full_path).size if File.file?(full_path)
end
- c = Change.find(
- :first,
- :include => :changeset,
- :conditions => [
- "#{Change.table_name}.revision = ? and #{Changeset.table_name}.repository_id = ?",
- e.lastrev.revision,
- id
- ],
- :order => "#{Changeset.table_name}.revision DESC")
+ c = Change.
+ includes(:changeset).
+ where("#{Change.table_name}.revision = ? and #{Changeset.table_name}.repository_id = ?", e.lastrev.revision, id).
+ order("#{Changeset.table_name}.revision DESC").
+ first
if c
e.lastrev.identifier = c.changeset.revision
e.lastrev.name = c.changeset.revision