refactorit-logo

Getting random results from a database table using Active Record is a fairly common action that seems straightforward, but even though there are several ways to do it, they all have their drawbacks and subtleties. For this post I will use Rails 4.2.3 with PostgresSQL 9.3 for all the examples.

Read more...