From 75295531c622cb2f368cadbafe0fce492a283918 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 19 Feb 2018 17:17:52 -0300 Subject: [PATCH] eliminar valores vacios del frontmatter closes #35 --- app/models/post.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/post.rb b/app/models/post.rb index bd80b2c..e2950a8 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -232,6 +232,13 @@ class Post date_to_time! clean_content! slugify_title! + remove_empty_front_matter! + end + + def remove_empty_front_matter! + @front_matter.delete_if do |k,v| + v.blank? + end end # Aplica limpiezas básicas del contenido