add a comment explaining why this code is so verbose

This commit is contained in:
joshua stein 2016-01-20 13:41:02 -06:00
parent d10f567a26
commit f53aced518

View file

@ -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
" "