fix truncate bug when map desc is nil (#557)

This commit is contained in:
Devin Howard 2016-06-16 15:42:43 +08:00 committed by GitHub
parent b0860ef670
commit 1f9078638e

View file

@ -8,7 +8,7 @@ module MapsHelper
map['id'] = m.id
map['label'] = m.name
map['value'] = m.name
map['description'] = m.desc.truncate(30)
map['description'] = m.desc.try(:truncate, 30)
map['permission'] = m.permission
map['topicCount'] = m.topics.count
map['synapseCount'] = m.synapses.count