From e61e433e80d8dc44b19400a85e3db3df42e1e200 Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Thu, 9 Feb 2017 02:37:43 +0100 Subject: [PATCH] gotta love ruby --- lib/helpers/preprocess.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/helpers/preprocess.rb b/lib/helpers/preprocess.rb index 0c3a0a0..4a6a1ee 100644 --- a/lib/helpers/preprocess.rb +++ b/lib/helpers/preprocess.rb @@ -8,14 +8,12 @@ module PreprocessHelper def update_blog_attributes @items.find_all('/blog/**/*').each do |i| - attr_hash = { + i.update_attributes( # Tag all posts with article (for Blogging helper) kind: 'article', academic_year: i.identifier.to_s[/\d\d-\d\d/], created_at: Date.parse(i[:created_at]) - } - - i.update_attributes(attr_hash) + ) end end