From fd6b7b4a300c9121806ec487001f763f011ee700 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 5 Sep 2014 17:27:53 +0300 Subject: Pluralize commit text for note when push to existing MR Signed-off-by: Dmitriy Zaporozhets --- app/models/note.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/note.rb b/app/models/note.rb index deda494f475..7cbab1130ea 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -118,7 +118,8 @@ class Note < ActiveRecord::Base end def create_new_commits_note(noteable, project, author, commits) - body = "Pushed new commits:\n\n" + commits_text = ActionController::Base.helpers.pluralize(commits.size, 'new commit') + body = "Added #{commits_text}:\n\n" commits.each do |commit| message = "* #{commit.short_id} - #{commit.title}" -- cgit v1.2.1