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