devise session templates to haml. Fix problem with missing message in commit

This commit is contained in:
Dmitriy Zaporozhets 2012-09-03 08:13:51 +03:00
parent 0c5e556922
commit c7cfe3d83b
5 changed files with 58 additions and 66 deletions

View file

@ -16,6 +16,8 @@ class CommitDecorator < ApplicationDecorator
# In case this first line is longer than 80 characters, it is cut off
# after 70 characters and ellipses (`&hellp;`) are appended.
def title
return no_commit_message unless safe_message
title_end = safe_message.index(/\n/)
if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)
safe_message[0..69] << "&hellip;".html_safe
@ -35,4 +37,10 @@ class CommitDecorator < ApplicationDecorator
safe_message.split(/\n/, 2)[1].try(:chomp)
end
end
protected
def no_commit_message
"--no commit message"
end
end