Skip to content

Commit

Permalink
source recent search optimized
Browse files Browse the repository at this point in the history
  • Loading branch information
proceps committed Sep 4, 2020
1 parent 04af0ce commit 9a9bedb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/models/serial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ def self.select_optimized(user_id, project_id)
h = {
recent: (
Serial.where('"serials"."id" IN (?)', r.first(10) ).order(:name).to_a +
Serial.recently_created
.where(created_by_id: user_id)
.distinct
.limit(5).to_a).uniq.sort{|a,b| a.name <=> b.name},
Serial.where(created_by_id: user_id, created_at: 3.hours.ago..Time.now).limit(5).to_a).uniq,
pinboard: Serial.pinned_by(user_id).pinned_in_project(project_id).to_a
}

Expand Down

0 comments on commit 9a9bedb

Please sign in to comment.