Skip to content

Instantly share code, notes, and snippets.

@mrbrdo
Created April 2, 2011 22:30
Show Gist options
  • Save mrbrdo/899967 to your computer and use it in GitHub Desktop.
Save mrbrdo/899967 to your computer and use it in GitHub Desktop.
ruby-1.8.7-p334 :021 > p.professor_at_programmes.by_rating("ASC").includes(:professor).to_sql => "SELECT \"professor_at_programmes\".* FROM \"professor_at_programmes\" WHERE (\"professor_at_programmes\".programme_id = 1) AND (num_scores > 0) ORDER BY ((num_scores / (num_scores + 1.0)) * (score / num_scores) + (1.0 / (num_scores + 1.0)) * 3.16666666666667) ASC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment