Commit ff40b7de7a6451bb9e3bc12a18070bbff13b6a68

Authored by Riyad Preukschas
1 parent 8b7e404b

Add CommitDecorator#short_id

Showing 1 changed file with 4 additions and 0 deletions   Show diff stats
app/decorators/commit_decorator.rb
1 1 class CommitDecorator < ApplicationDecorator
2 2 decorates :commit
3 3  
  4 + def short_id(length = 10)
  5 + id.to_s[0..length]
  6 + end
  7 +
4 8 # Returns the commits title.
5 9 #
6 10 # Usually, the commit title is the first line of the commit message.
... ...