mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:22:46 +08:00
Added some missing references, see https://github.com/rails/rails/issues/12982
This commit is contained in:
parent
9cecabd023
commit
e41eecb91b
|
@ -61,10 +61,7 @@ class Post < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.find_by_detail(key, value)
|
def self.find_by_detail(key, value)
|
||||||
includes(:post_details).where( "post_details.key = ? AND " +
|
includes(:post_details).where(post_details: { key: key, value: value }).first
|
||||||
"post_details.value = ?",
|
|
||||||
key,
|
|
||||||
value ).first
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_detail(key, value, extra = nil)
|
def add_detail(key, value, extra = nil)
|
||||||
|
|
|
@ -242,6 +242,7 @@ class TopicQuery
|
||||||
else
|
else
|
||||||
result = result.where('topics.category_id IS NULL')
|
result = result.where('topics.category_id IS NULL')
|
||||||
end
|
end
|
||||||
|
result = result.references(:categories)
|
||||||
end
|
end
|
||||||
|
|
||||||
result
|
result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user