From f53aced5185bd03e0b9225a9c27be9137d76c745 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Wed, 20 Jan 2016 13:41:02 -0600 Subject: [PATCH] add a comment explaining why this code is so verbose --- app/models/story.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/story.rb b/app/models/story.rb index 4f807b1..094322b 100644 --- a/app/models/story.rb +++ b/app/models/story.rb @@ -468,6 +468,8 @@ class Story < ActiveRecord::Base end def fix_bogus_chars + # this is needlessly complicated to work around character encoding issues + # that arise when doing just self.title.to_s.gsub(160.chr, "") self.title = self.title.to_s.split("").map{|chr| if chr.ord == 160 " "