mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-21 10:36:04 +10:00
Add CommitDecorator#short_id
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user