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
|
@ -15,9 +15,11 @@
|
|||
class Rule < ApplicationRecord
|
||||
include Discard::Model
|
||||
|
||||
TEXT_SIZE_LIMIT = 300
|
||||
|
||||
self.discard_column = :deleted_at
|
||||
|
||||
validates :text, presence: true, length: { maximum: 300 }
|
||||
validates :text, presence: true, length: { maximum: TEXT_SIZE_LIMIT }
|
||||
|
||||
scope :ordered, -> { kept.order(priority: :asc, id: :asc) }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue