Selaa lähdekoodia

Trap nil object instead of string in title/description cleanup filter #2

master
Adrian Short 14 vuotta sitten
vanhempi
commit
50c0b78fa0
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. +4
    -0
      app/helpers/posts_helper.rb

+ 4
- 0
app/helpers/posts_helper.rb Näytä tiedosto

@@ -33,6 +33,10 @@ module PostsHelper
end end
def clean_description(s) def clean_description(s)
if s.nil?
return ""
end
if s.size > 137 if s.size > 137
s = s[0..136] + '...' s = s[0..136] + '...'
end end


Ladataan…
Peruuta
Tallenna