Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -143,14 +143,11 @@ class Repository::Cvs < Repository
|
||||
)
|
||||
cmt = Changeset.normalize_comments(revision.message, repo_log_encoding)
|
||||
author_utf8 = Changeset.to_utf8(revision.author, repo_log_encoding)
|
||||
cs = changesets.find(
|
||||
:first,
|
||||
:conditions => {
|
||||
:committed_on => tmp_time - time_delta .. tmp_time + time_delta,
|
||||
:committer => author_utf8,
|
||||
:comments => cmt
|
||||
}
|
||||
)
|
||||
cs = changesets.where(
|
||||
:committed_on => tmp_time - time_delta .. tmp_time + time_delta,
|
||||
:committer => author_utf8,
|
||||
:comments => cmt
|
||||
).first
|
||||
# create a new changeset....
|
||||
unless cs
|
||||
# we use a temporaray revision number here (just for inserting)
|
||||
@@ -185,10 +182,10 @@ class Repository::Cvs < Repository
|
||||
end
|
||||
|
||||
# Renumber new changesets in chronological order
|
||||
Changeset.all(
|
||||
:order => 'committed_on ASC, id ASC',
|
||||
:conditions => ["repository_id = ? AND revision LIKE 'tmp%'", id]
|
||||
).each do |changeset|
|
||||
Changeset.
|
||||
order('committed_on ASC, id ASC').
|
||||
where("repository_id = ? AND revision LIKE 'tmp%'", id).
|
||||
each do |changeset|
|
||||
changeset.update_attribute :revision, next_revision_number
|
||||
end
|
||||
end # transaction
|
||||
|
||||
Reference in New Issue
Block a user