Add CommitDecorator#short_id
This commit is contained in:
parent
8b7e404b5b
commit
ff40b7de7a
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,10 @@
|
|||
class CommitDecorator < ApplicationDecorator
|
||||
decorates :commit
|
||||
|
||||
def short_id(length = 10)
|
||||
id.to_s[0..length]
|
||||
end
|
||||
|
||||
# Returns the commits title.
|
||||
#
|
||||
# Usually, the commit title is the first line of the commit message.
|
||||
|
|
Loading…
Reference in a new issue