2
0

Extract constants for column size length validation limits (#30045)

This commit is contained in:
Matt Jankowski
2024-04-24 04:56:28 -04:00
committed by GitHub
parent ebcf9840f4
commit f4a53f3fb4
7 changed files with 21 additions and 7 deletions

View File

@@ -13,10 +13,12 @@
#
class ReportNote < ApplicationRecord
CONTENT_SIZE_LIMIT = 500
belongs_to :account
belongs_to :report, inverse_of: :notes, touch: true
scope :latest, -> { reorder(created_at: :desc) }
validates :content, presence: true, length: { maximum: 500 }
validates :content, presence: true, length: { maximum: CONTENT_SIZE_LIMIT }
end