commit.short_id as model method. Styled inline comment form
This commit is contained in:
parent
67ef96ea5f
commit
0590aa9d60
7 changed files with 46 additions and 23 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue