##// END OF EJS Templates
scm: use #blank? instead of #nil? || #empty? at Repository#find_changeset_by_name(name) (#7307)....
Toshi MARUYAMA -
r4592:acb0d9661739
parent child
Show More
@@ -98,13 +98,13 class Repository < ActiveRecord::Base
98 def relative_path(path)
98 def relative_path(path)
99 path
99 path
100 end
100 end
101
101
102 # Finds and returns a revision with a number or the beginning of a hash
102 # Finds and returns a revision with a number or the beginning of a hash
103 def find_changeset_by_name(name)
103 def find_changeset_by_name(name)
104 return nil if name.nil? || name.empty?
104 return nil if name.blank?
105 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
105 changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%']))
106 end
106 end
107
107
108 def latest_changeset
108 def latest_changeset
109 @latest_changeset ||= changesets.find(:first)
109 @latest_changeset ||= changesets.find(:first)
110 end
110 end
General Comments 0
You need to be logged in to leave comments. Login now