mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-28 15:03:58 -04:00
Use unscoped
instead of with_deleted
This commit is contained in:
parent
d065d4186a
commit
35922bf692
1 changed files with 2 additions and 2 deletions
|
@ -131,10 +131,10 @@ class Search
|
||||||
def self.min_post_id_no_cache
|
def self.min_post_id_no_cache
|
||||||
return 0 unless SiteSetting.search_prefer_recent_posts?
|
return 0 unless SiteSetting.search_prefer_recent_posts?
|
||||||
|
|
||||||
offset = Post.with_deleted.count - SiteSetting.search_recent_posts_size
|
offset = Post.unscoped.count - SiteSetting.search_recent_posts_size
|
||||||
return 0 if offset <= 0
|
return 0 if offset <= 0
|
||||||
|
|
||||||
Post.with_deleted.order(:id).offset(offset).limit(1).pluck(:id)[0]
|
Post.unscoped.order(:id).offset(offset).limit(1).pluck(:id)[0]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.min_post_id(opts=nil)
|
def self.min_post_id(opts=nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue