mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:32:45 +08:00
FIX: ActiveRecord error when calling find
for the topic list key.
This commit is contained in:
parent
f88075cbba
commit
2c989f3eb3
|
@ -20,11 +20,11 @@ class TopicList
|
|||
|
||||
def preload_key
|
||||
if @opts[:category]
|
||||
c = Category.find(@opts[:category_id])
|
||||
"topic_list_#{c.url.sub(/^\//, '')}/l/#{@filter}"
|
||||
else
|
||||
"topic_list_#{@filter}"
|
||||
c = Category.where(id: @opts[:category_id]).first
|
||||
return "topic_list_#{c.url.sub(/^\//, '')}/l/#{@filter}" if c
|
||||
end
|
||||
|
||||
"topic_list_#{@filter}"
|
||||
end
|
||||
|
||||
# Lazy initialization
|
||||
|
|
Loading…
Reference in New Issue
Block a user