diff options
author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-07-21 19:37:31 +0200 |
---|---|---|
committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-07-21 19:59:55 +0200 |
commit | ff40b7de7a6451bb9e3bc12a18070bbff13b6a68 (patch) | |
tree | eef3353dae91edd66353f4f899df5243232b2f3a /app/decorators | |
parent | 8b7e404b5b6944e9c92cc270b2e5d0005781d49d (diff) | |
download | gitlab-ce-ff40b7de7a6451bb9e3bc12a18070bbff13b6a68.tar.gz |
Add CommitDecorator#short_id
Diffstat (limited to 'app/decorators')
-rw-r--r-- | app/decorators/commit_decorator.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index cc8fa97587b..d9c880bee72 100644 --- a/app/decorators/commit_decorator.rb +++ b/app/decorators/commit_decorator.rb @@ -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. |