commit.short_id as model method. Styled inline comment form

This commit is contained in:
randx 2012-07-27 11:22:05 +03:00
parent 67ef96ea5f
commit 0590aa9d60
7 changed files with 46 additions and 23 deletions

View file

@ -114,6 +114,10 @@ class Commit
@head = head
end
def short_id(length = 10)
id.to_s[0..length]
end
def safe_message
utf8 message
end
@ -150,4 +154,8 @@ class Commit
def prev_commit_id
prev_commit.try :id
end
def parents_count
parents && parents.count || 0
end
end