Fix: Added the backend validation for name (#3878)

- Added the backend validation for name
- Add message size constraint
This commit is contained in:
Tejaswini Chile
2022-02-03 03:51:17 +05:30
committed by GitHub
parent e99ea0b582
commit 8821106da9
10 changed files with 83 additions and 1 deletions

View File

@@ -39,6 +39,7 @@ class Message < ApplicationRecord
validates :conversation_id, presence: true
validates_with ContentAttributeValidator
validates :content_type, presence: true
validates :content, length: { maximum: 150_000 }
# when you have a temperory id in your frontend and want it echoed back via action cable
attr_accessor :echo_id