summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/decorators/commit_decorator.rb4
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.