From: Aidan Cornelius-Bell Date: Sun, 15 Sep 2024 07:16:44 +0000 (+0930) Subject: API V2 Tweaks X-Git-Url: https://gitweb.mndrdr.org/?a=commitdiff_plain;h=0944295788da87e120e1984ab9aa34bc77903300;p=arelpe.git API V2 Tweaks --- diff --git a/app/models/post.rb b/app/models/post.rb index 8c63ab2..faff1f1 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -63,7 +63,7 @@ class Post < ApplicationRecord private def set_slug - self.slug = title.parameterize + self.slug = title.present? ? title.parameterize : nil end def set_published_at