Extract constants for column size length validation limits (#30045)
This commit is contained in:
@@ -14,9 +14,11 @@
|
||||
class AccountNote < ApplicationRecord
|
||||
include RelationshipCacheable
|
||||
|
||||
COMMENT_SIZE_LIMIT = 2_000
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :target_account, class_name: 'Account'
|
||||
|
||||
validates :account_id, uniqueness: { scope: :target_account_id }
|
||||
validates :comment, length: { maximum: 2_000 }
|
||||
validates :comment, length: { maximum: COMMENT_SIZE_LIMIT }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user