]> gitweb.mndrdr.org Git - arelpe.git/commitdiff
API V2 Tweaks
authorAidan Cornelius-Bell <[email protected]>
Sun, 15 Sep 2024 07:16:44 +0000 (16:46 +0930)
committerAidan Cornelius-Bell <[email protected]>
Sun, 15 Sep 2024 07:16:44 +0000 (16:46 +0930)
app/models/post.rb

index 8c63ab2f76f7cf8d9d2fc039e405a4c672c834ef..faff1f1c93d9915bc1529d2ce12b6136030d6ffe 100644 (file)
@@ -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