diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-09-03 08:13:51 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-09-03 08:15:07 +0300 |
commit | c7cfe3d83bfbad2a074cacb5a4ed8a24244f8f26 (patch) | |
tree | 81b4856697186c42da5727c9797c2e8b68b4103f /app/decorators/commit_decorator.rb | |
parent | 0c5e556922b4c7ff71c6af6255a0f6783e25ca0c (diff) | |
download | gitlab-ce-c7cfe3d83bfbad2a074cacb5a4ed8a24244f8f26.tar.gz |
devise session templates to haml. Fix problem with missing message in commit
Diffstat (limited to 'app/decorators/commit_decorator.rb')
-rw-r--r-- | app/decorators/commit_decorator.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/decorators/commit_decorator.rb b/app/decorators/commit_decorator.rb index 074176ae802..f813ed253d7 100644 --- a/app/decorators/commit_decorator.rb +++ b/app/decorators/commit_decorator.rb @@ -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] << "…".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 |