diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-23 10:11:19 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-02-23 10:11:19 +0000 |
commit | a26100666600dbef1077ee3f651550f50979fba9 (patch) | |
tree | 8d603df221c4bcaed9ef77b1dc3cb043c6c09a4b | |
parent | 5033a155b3e5f59dbd374f5bd30cde25aff18150 (diff) | |
download | redmine-a26100666600dbef1077ee3f651550f50979fba9.tar.gz redmine-a26100666600dbef1077ee3f651550f50979fba9.zip |
scm: use to_s for revision in find_changeset_by_name method
On Rails 3.0.11, Subversion functional test fails.
<pre>
Error: test_directory_diff(RepositoriesSubversionControllerTest)
NoMethodError: undefined method `match' for 2:Fixnum
app/models/repository.rb:234:in `find_changeset_by_name'
</pre>
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8931 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/repository.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 8ad339970..290664600 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -231,8 +231,9 @@ class Repository < ActiveRecord::Base # Finds and returns a revision with a number or the beginning of a hash def find_changeset_by_name(name) return nil if name.blank? - changesets.find(:first, :conditions => (name.match(/^\d*$/) ? - ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) + s = name.to_s + changesets.find(:first, :conditions => (s.match(/^\d*$/) ? + ["revision = ?", s] : ["revision LIKE ?", s + '%'])) end def latest_changeset |