Commit 7e2846fb57ef24dfac0de57f7b086a7415cc44e7

Authored by Vanja Radovanović
1 parent 8d171a8c

using blank?, much shorter

app/decorators/commit_decorator.rb
@@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator @@ -16,7 +16,7 @@ class CommitDecorator < ApplicationDecorator
16 # In case this first line is longer than 80 characters, it is cut off 16 # In case this first line is longer than 80 characters, it is cut off
17 # after 70 characters and ellipses (`&hellp;`) are appended. 17 # after 70 characters and ellipses (`&hellp;`) are appended.
18 def title 18 def title
19 - return no_commit_message unless safe_message && !safe_message.strip.empty? 19 + return no_commit_message if safe_message.blank?
20 20
21 title_end = safe_message.index(/\n/) 21 title_end = safe_message.index(/\n/)
22 if (!title_end && safe_message.length > 80) || (title_end && title_end > 80) 22 if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)
app/helpers/gitlab_markdown_helper.rb
@@ -11,7 +11,7 @@ module GitlabMarkdownHelper @@ -11,7 +11,7 @@ module GitlabMarkdownHelper
11 # explicitly produce the correct linking behavior (i.e. 11 # explicitly produce the correct linking behavior (i.e.
12 # "<a>outer text </a><a>gfm ref</a><a> more outer text</a>"). 12 # "<a>outer text </a><a>gfm ref</a><a> more outer text</a>").
13 def link_to_gfm(body, url, html_options = {}) 13 def link_to_gfm(body, url, html_options = {})
14 - return "" unless body && !body.strip.empty? 14 + return "" if body.blank?
15 15
16 gfm_body = gfm(body, html_options) 16 gfm_body = gfm(body, html_options)
17 17