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.
-
A blog of musings about many things, most particularly humanity; its origins and destiny as well as other interesting and useful things which I have encountered
No comments:
Post a Comment