Created
July 14, 2017 02:28
-
-
Save Ravenclaw968/65681f48eeb929b125d0ca980a74d345 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Competition.joins("LEFT JOIN keywords_and_users ON keywords_and_users.user_id = #{session[:user_id]}").where(id: CompetitionsAndKeyword.where(keyword_id: KeywordsAndUser.where(user_id: session[:user_id]).pluck(:keyword_id)).pluck(:competition_id)).order("(interested / views) * keywords_and_users.score DESC") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment