]> source.dussan.org Git - redmine.git/commitdiff
scm: use #blank? instead of #nil? || #empty? at Repository#find_changeset_by_name...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 14 Jan 2011 22:51:12 +0000 (22:51 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 14 Jan 2011 22:51:12 +0000 (22:51 +0000)
Referring r4711.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4712 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index 0a5b426c7126a037b713d2c82970149249d9b6df..3d463b82fac18873717d38c239f7fb0a59f38765 100644 (file)
@@ -98,13 +98,13 @@ class Repository < ActiveRecord::Base
   def relative_path(path)
     path
   end
-  
+
   # Finds and returns a revision with a number or the beginning of a hash
   def find_changeset_by_name(name)
-    return nil if name.nil? || name.empty?
+    return nil if name.blank?
     changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
   end
-  
+
   def latest_changeset
     @latest_changeset ||= changesets.find(:first)
   end