Skip to content
Open

test #11

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ class Comment < ApplicationRecord
belongs_to :user
belongs_to :post

validates :text, presence: true
# Validations

validates :text, presence: true, length: { minimum: 5, maximum: 1_000 }

after_create :increment_post_comments_counter

Expand Down