Archive for February, 2006

Posted on February 14, 2006 at 9:43 pm

Have you ever wanted to pass a block to an ActiveRecord model in order to pre-filter results?

module ActiveRecord
  class Base
    class < < self
      alias_method :find_without_filter, :find
      def find(*args)
        records = find_without_filter(*args)
        if block_given?
          filtered = []
          records.each do |record|
            filtered << record if yield(record)
          end
          filtered
        else
          records
        end
      end
    end
  end
end

This is a quick and dirty hack of a plugin, but it does the trick. I’m far from satisfied though. Soliciting opinions from those in the know. Email me.

Posted on February 10, 2006 at 6:18 pm

I didn’t have to wait long for assurance_Why is putting (pudding?) on one of his “performances” at RubyConf 2006. Via Loudthinking.

Posted on February 8, 2006 at 11:07 am

Ioan has talked me into training for the San Diego marathon. I started pre-training a couple of weeks ago, and this week is the first of the 16 week training schedule leading up to the marathon on June 4th.

Up until last week, the longest run I have ever done in my life was 3 miles. Before last summer, I’m sure that I had never even run 1 mile before. Not even as a kid. I’ve now done three 4 mile runs, and the run this Saturday is going to be 5 miler. This should be interesting.

I’ll be periodically checking off the days on my Marathon Training Schedule.

Posted on February 1, 2006 at 11:27 pm

Railsconf 2006 was announced today. I’m signing up and booking everything for the trip tomorrow.

Update: I couldn’t bear the thought of not being one of the first 100 to sign up. I’m booked. Now… I want to be assured that _why is going to put on one of his audio/visual extravaganza’s.