Jeremy Durham

Ruby, Rails, and everything in between.

  • BlogThoughts
  • AboutAbout the Author
  • ContactGet in touch

January 23, 2006 20:12
Posted by Jeremy Durham

Ruby/Rails sweetness

Alright, I hate stealing from other people, but I found this on projectionist and HAD to repost it. It’s for generating a “BETWEEN date1 and date2” SQL fragment:

(6.months.ago.to_date..1.year.ago.to_date).to_s(:db)

Which produces:

=> "BETWEEN '2005-07-28' AND '2005-01-23'"

OK, that is seriously too sweet.

No Comments

Posted Under Programming

0 Comments

Leave a comment

* = Required
  • Posts
  • Twitter
  • Flickr
 

There is no Holy ...

Technology

 

Google and Apple:...

Technology

 

Setting up Git an...

Technology

@mariusrugan awesome, glad I was able to be of some help

follow me on
twitter

125942640_a3dcc3f951_s125942637_c4524c7c88_s125942628_a682f8a639_s122144184_5f2dd86929_s122144182_1b01ded312_s122144181_893a82f1d3_s122144179_70465b00ff_s122102402_21e6174af6_s122102401_f6d9ebff55_s

Categories

  • Technology
  • Programming
  • Family
  • Travel

This site is using the Handgloves WordPress Theme
Designed & Developed by George Wiscombe

Subscribe via RSS