FIX: case-insensitive category lookup when creating topics

This commit is contained in:
Neil Lalonde
2014-08-18 11:07:32 -04:00
parent 6c10cc3788
commit 1445ad61da
5 changed files with 30 additions and 1 deletions

View File

@ -73,7 +73,7 @@ class TopicCreator
if (@opts[:category].is_a? Integer) || (@opts[:category] =~ /^\d+$/)
Category.find_by(id: @opts[:category])
else
Category.find_by(name: @opts[:category])
Category.find_by(name_lower: @opts[:category].try(:downcase))
end
end