02 Jun 2006

Worlds Smallest Rails Contributor

(warning, the following blog post is exceedingly geeky...)
This is about the smallest thing I could have possibly done, but I am now a Ruby on Rails contributor.
I found a bug with Rails Calculations where I was trying to do this :
@object.linking_tables.count(:conditions => ['fieldname = ?', 1])
and it was failing with malformed SQL. Apparently, in 1.1, it is only designed to do stuff like this :
ObjectClass.count(:conditions => ['fieldname = ?', 1])
Which may not look that different, but it really loses a lot of power - the instantiated object and the association are both scope limiters on the query.
So, I thought I'd be all cool and make the former work - so I setup a patch environment and ran the base AR tests and one broke. I figured out what it was that broke and generated a tiny (tiny) patch and submitted it and it was applied to the trunk a few minutes ago. So, now I'm the worlds smallest Rails contributor:
http://dev.rubyonrails.org/ticket/5268
However, I then soon found out that the Calculations have already been modified in the way I was hoping, after I wrote a few tests and they all passed fine. So, edge Rails works the way I hoped, but I don't get to contribute in a substantial way. Well, at least I know something that will be in 1.2. Hopefully next time I can do something more useful.
blog comments powered by Disqus