Posted by
john on Jun 23rd, 2010 in
Ruby |
Comments Off
There are plenty of times when I want to grab either one or many random records from a database in Rails. For instance, one random user, one random post, 5 random items, etc. Honestly, it’s one of those things I do in nearly every app I’ve written, so a while ago I created a module to add to any ActiveRecord class that gave me one() and some() methods. This way, I can just include Randomizer and have the...
Posted by
john on Feb 1st, 2010 in
Ruby |
Comments Off
I’ve been getting really grumpy lately because strange things keep happening when I try to build Ruby apps– specifically on Rails. It turns out that some of my problems weren’t due to my horrible lack of competence, but instead to the fact that the Ruby installation on Snow Leopard (installed from Xtools) had some weird things going on with regards to Gems. I thought I’d throw it up here...