softwareas.com
Monkey-patching a sample() method in Rails
It’s useful while debugging to choose a random sample. Thus you can include something like this in application.rb or an initializer. Now you can say `Post.sample` to get a single post or `Pos…