08.29.07
22:39

While working on a scheduling application tonight, I found a neat Ruby code snippet that lets you easily convert a Ruby date range to SQL.


(6.months.ago.to_date..1.year.ago.to_date).to_s(:db)
=> "BETWEEN '2005-07-27' AND '2005-01-22'"


Source

Rss - Subscribe to the Feed
© Copyright 2005-2007 Sliced Software, Inc.