Jim Kingdon's blog



New York Standup 9/30/2008

edit Posted by Jim Kingdon on Tuesday September 30, 2008 at 07:02PM

  • What's the best way to import a million records into a postgres database via ActiveRecord (which is needed to implement some application-specific logic)? We anticipate waiting a second (or so) between inserts to avoid slowing down the production database (which is under load, almost entirely reads). If there is any ActiveRecord feature which helps batch together inserts, noone knew about it. As for generally how long this will take (estimates range from 9 to 27 hours), and what the load on the production database will be, we planned on answering that with a trial run of a small number of these records.

  • We're thinking of having capistrano deploy to two demo servers, one particularly aimed at showing to prospective users of our application, and the other mostly for story acceptance. The former would be hosted at a hosting company; the latter an internally run machine. Several people reported they have done this on their projects, and the problems were minor, mostly having to do with whether the deployed location (/u/apps/whatever or some such) is different on the two machines (the solution would be to use the capistrano variables, but tracking down all the places that need to do that could be an issue).

  • Erector tip of the day: in a Rails project, you can put a file (named edit.rb or edit.html.rb) in your view directory, and Rails/Erector will find the template implicitly (as it would for ERB, HAML, etc). It is not necessary to explicitly call render from your controller method.

Standup 08/27/2008

edit Posted by Jim Kingdon on Wednesday August 27, 2008 at 04:26PM

  • Does anyone have any experiences with one of the object mother libraries like object daddy? (Answers at standup were "no, we always wrote our own object mothers in a domain-specific way"). The appeal of a library is that it might help keep track of what needs to be done to make an object pass rails validation.

  • Clock.zone now has exists. (Background, pivotal has a Clock class which has a now method which can be implemented either by a call to Time.now for production, or a mock clock which lets tests specify the "time"). This is so that the rails 2.1 features like Time.zone.now have an analog in Clock.

Standup 08/26/2008

edit Posted by Jim Kingdon on Tuesday August 26, 2008 at 04:14PM

  • Looking for options to maintain a website of technical documentation with the following:

    • A somewhat technical person, but not a programmer, must be able to maintain the site (think a technical manager or a tech writer).
    • I need to display code samples, so this should be easy/convenient
    • Somewhat skinnable (custom logo, custom fonts & colors)

    The ideal examples would be the google chart api or google maps api

    A possible solution is a wiki (mediawiki?). Something google-code-like gets extra points for the issue tracker. Google groups gets points for the mailing list. Google sites seems like is might be a decent basic option (it's easy to point a CNAME at it too).

    Experience reports/recommendations appreciated.

  • Rails hackfest is on through the end of August. Get points for getting patches accepted, and win prizes.