Skip to content

Instantly share code, notes, and snippets.

@MaxPleaner
Last active September 20, 2016 10:10
Show Gist options
  • Save MaxPleaner/c39bf16e8b036f262b19c9bccf0d01a1 to your computer and use it in GitHub Desktop.
Save MaxPleaner/c39bf16e8b036f262b19c9bccf0d01a1 to your computer and use it in GitHub Desktop.
priority merge example 1
result_sets = {
top_rated: Post.all.order(rating: :desc).first(50),
top_rated_in_followed_topic: Post.all.where(topic_id: @user.followed_topics.pluck(:id)).order(rating: :desc).first(50)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment