gotta love ruby

This commit is contained in:
Lorin Werthen 2017-02-09 02:37:43 +01:00
parent a374c3d589
commit e61e433e80
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0

View file

@ -8,14 +8,12 @@ module PreprocessHelper
def update_blog_attributes def update_blog_attributes
@items.find_all('/blog/**/*').each do |i| @items.find_all('/blog/**/*').each do |i|
attr_hash = { i.update_attributes(
# Tag all posts with article (for Blogging helper) # Tag all posts with article (for Blogging helper)
kind: 'article', kind: 'article',
academic_year: i.identifier.to_s[/\d\d-\d\d/], academic_year: i.identifier.to_s[/\d\d-\d\d/],
created_at: Date.parse(i[:created_at]) created_at: Date.parse(i[:created_at])
} )
i.update_attributes(attr_hash)
end end
end end