Fixes #313 - Without a slug the search urls were wrong.
This commit is contained in:
parent
1205e0d3d4
commit
88bb25f2f6
|
@ -155,7 +155,11 @@ module Search
|
||||||
type = row.delete('type')
|
type = row.delete('type')
|
||||||
|
|
||||||
# Add the slug for topics
|
# Add the slug for topics
|
||||||
row['url'].gsub!('slug', Slug.for(row['title'])) if type == 'topic'
|
if type == 'topic'
|
||||||
|
new_slug = Slug.for(row['title'])
|
||||||
|
new_slug = "topic" if new_slug.blank?
|
||||||
|
row['url'].gsub!('slug', new_slug)
|
||||||
|
end
|
||||||
|
|
||||||
# Remove attributes when we know they don't matter
|
# Remove attributes when we know they don't matter
|
||||||
row.delete('id')
|
row.delete('id')
|
||||||
|
|
Loading…
Reference in New Issue