Skip to content

Commit 154867f

Browse files
committed
improved comment thread title validation message
1 parent 2179a3f commit 154867f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

app/models/comment_thread.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class CommentThread < ApplicationRecord
1212
scope :archived, -> { where(archived: true) }
1313

1414
validate :maximum_title_length
15-
validates :title, presence: true
15+
validates :title, presence: { message: I18n.t('comments.errors.title_presence') }
1616

1717
after_create :create_follower
1818

config/locales/strings/en.comments.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ en:
3131
Something went wrong when trying to undelete the comment.
3232
rename_thread_generic: >
3333
Failed to rename the thread.
34+
title_presence: >
35+
can't be empty after Markdown is removed.
3436
labels:
3537
create_new_thread: >
3638
Start new comment thread

0 commit comments

Comments
 (0)