Add CommitDecorator#short_id
This commit is contained in:
parent
8b7e404b5b
commit
ff40b7de7a
|
@ -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