Skip to content

Commit 0e15f8f

Browse files
committed
add validation for empty slugs
1 parent 1b4c51e commit 0e15f8f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/models/protip.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class Protip < ActiveRecord::Base
9797
validates :body, presence: true
9898
validates :kind, presence: true, inclusion: { in: KINDS }
9999
validates :topic_list, length: { minimum: 1 }
100+
validates :slug, presence: true
100101

101102
after_validation :tag_user
102103
before_create :assign_random_id

0 commit comments

Comments
 (0)