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
|
@ -12,6 +12,8 @@
|
|||
#
|
||||
|
||||
class UserInviteRequest < ApplicationRecord
|
||||
TEXT_SIZE_LIMIT = 420
|
||||
|
||||
belongs_to :user, inverse_of: :invite_request
|
||||
validates :text, presence: true, length: { maximum: 420 }
|
||||
validates :text, presence: true, length: { maximum: TEXT_SIZE_LIMIT }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue