The Life of a Radar

by_star
28 Apr 2010

It’s plugin / gem pimping time!

I started writing by\_star back in November 2008 when Thomas Sinclair asked me if I could write a method that could find records for a given month. I was in my gem creating phase then so I created a gem called by_month and Thomas paid me for it (the sucker!).

Later on, I realised that by_month wasn’t good enough so I added a couple more finders to it. Then I added some more. Now you can find by all of these things:

So if you’re ever doing anything in your application where you need to find by dates / times, why are you not using by\_star? Here’s a good reason you should be using by_star:

Before by\_star
 Post.all(:conditions => ["created_at >= ? AND created_at <= ?", "01/01/#{Time.now.year}".to_time, "31/01/#{Time.now.year}"])
After by\_star
Post.by_month(1)

This is only a taste of the shiny things in by_star! Use it!

blog comments powered by Disqus