mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
FIX: ActiveRecord error when calling find
for the topic list key.
This commit is contained in:
parent
f88075cbba
commit
2c989f3eb3
1 changed files with 4 additions and 4 deletions
|
@ -20,11 +20,11 @@ class TopicList
|
||||||
|
|
||||||
def preload_key
|
def preload_key
|
||||||
if @opts[:category]
|
if @opts[:category]
|
||||||
c = Category.find(@opts[:category_id])
|
c = Category.where(id: @opts[:category_id]).first
|
||||||
"topic_list_#{c.url.sub(/^\//, '')}/l/#{@filter}"
|
return "topic_list_#{c.url.sub(/^\//, '')}/l/#{@filter}" if c
|
||||||
else
|
|
||||||
"topic_list_#{@filter}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
"topic_list_#{@filter}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Lazy initialization
|
# Lazy initialization
|
||||||
|
|
Loading…
Reference in a new issue