Merge pull request #1737 from chancancode/add_missing_references
Added some missing references
This commit is contained in:
commit
0b13b8d7ea
|
@ -61,10 +61,7 @@ class Post < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.find_by_detail(key, value)
|
||||
includes(:post_details).where( "post_details.key = ? AND " +
|
||||
"post_details.value = ?",
|
||||
key,
|
||||
value ).first
|
||||
includes(:post_details).where(post_details: { key: key, value: value }).first
|
||||
end
|
||||
|
||||
def add_detail(key, value, extra = nil)
|
||||
|
|
|
@ -242,6 +242,7 @@ class TopicQuery
|
|||
else
|
||||
result = result.where('topics.category_id IS NULL')
|
||||
end
|
||||
result = result.references(:categories)
|
||||
end
|
||||
|
||||
result
|
||||
|
|
Loading…
Reference in New Issue