diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index cc8fa975..d9c880be 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.