scm: use #blank? instead of #nil? || #empty? at Repository#find_changeset_by_name(name) (#7307).
Referring r4711. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4712 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e14e244f7b
commit
acb0d96617
|
@ -98,13 +98,13 @@ class Repository < ActiveRecord::Base
|
||||||
def relative_path(path)
|
def relative_path(path)
|
||||||
path
|
path
|
||||||
end
|
end
|
||||||
|
|
||||||
# Finds and returns a revision with a number or the beginning of a hash
|
# Finds and returns a revision with a number or the beginning of a hash
|
||||||
def find_changeset_by_name(name)
|
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 + '%']))
|
changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
|
||||||
end
|
end
|
||||||
|
|
||||||
def latest_changeset
|
def latest_changeset
|
||||||
@latest_changeset ||= changesets.find(:first)
|
@latest_changeset ||= changesets.find(:first)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue