@@ -91,13 +91,13 class Repository < ActiveRecord::Base | |||||
91 | def relative_path(path) |
|
91 | def relative_path(path) | |
92 | path |
|
92 | path | |
93 | end |
|
93 | end | |
94 |
|
94 | |||
95 | # Finds and returns a revision with a number or the beginning of a hash |
|
95 | # Finds and returns a revision with a number or the beginning of a hash | |
96 | def find_changeset_by_name(name) |
|
96 | def find_changeset_by_name(name) | |
97 |
return nil if name. |
|
97 | return nil if name.blank? | |
98 | changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) |
|
98 | changesets.find(:first, :conditions => (name.match(/^\d*$/) ? ["revision = ?", name.to_s] : ["revision LIKE ?", name + '%'])) | |
99 | end |
|
99 | end | |
100 |
|
100 | |||
101 | def latest_changeset |
|
101 | def latest_changeset | |
102 | @latest_changeset ||= changesets.find(:first) |
|
102 | @latest_changeset ||= changesets.find(:first) | |
103 | end |
|
103 | end |
General Comments 0
You need to be logged in to leave comments.
Login now