Tuesday, April 7, 2009

ruby makes you smile

def self.randy n
(1 + (rand * n-1).round)
end

Thing.create!(:bob => randy(730).days.ago.to_date)

I know its nothing that complex, but it just highlights how friendly Ruby is.

No comments:

Post a Comment