Here is the commit where Chris modified the format of the queries for performance.
https://github.com/ets-berkeley-edu/calcentral/commit/8081b27a4cd539af9a0ec12a69b49adaa3f9d3ef

I can see that the major thing he did was remove the method that wrapped the integer in single quotes (denoting a string rather than integer).

The SQL query itself is still a string, so the 'to_i' call doesn't seem completely necessary.
http://pastie.org/private/ikhe9p2pmq5mge3ayr5j7a