Extract constants for column size length validation limits (#30045)
This commit is contained in:
parent
ebcf9840f4
commit
f4a53f3fb4
7 changed files with 21 additions and 7 deletions
|
@ -13,10 +13,12 @@
|
|||
#
|
||||
|
||||
class AccountModerationNote < ApplicationRecord
|
||||
CONTENT_SIZE_LIMIT = 500
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :target_account, class_name: 'Account'
|
||||
|
||||
scope :latest, -> { reorder('created_at DESC') }
|
||||
|
||||
validates :content, presence: true, length: { maximum: 500 }
|
||||
validates :content, presence: true, length: { maximum: CONTENT_SIZE_LIMIT }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue