Monthly Archives: June 2006

STI, acts_as_tree, and xml_response_from

More Land Brokr/NCRE integration means more xml_response_fromhackery. This one involves the message center. NCRE messages are STI trees. That is: class Message < ActiveRecord::Base acts_as_tree :order => ‘created_at DESC’ end class PurchaseMessage < Message def summary “blah blah” end end class OpenHouseMessage < Message def summary “blah blah” end end So the code to send […]

STI and to_xml

As I mentioned in the explanation for my response_from plugin, I have two apps that communicate via a private XML REST API. This is trivial using my xml_response_from method (in my response_from plugin) and with Rail's to_xml; trivial, that is, unless you want to use single table inheritance. For example, let's say you have:  class […]


It's not a big secret: I'm writing blogging software. This, in a sense, sucks because it's already been written many, many times; while I coded I often (like, every 20 minutes) tried to think of how this could be abstracted into a plugin or five. Since this is a big task I might do it […]

response_from: the opposite of respond_to render :xml

Update: This can be replaced, mostly, with Rails 2.0’s ActiveRecord#from_xml. As I assured in a prior post, I spent today hacking on a plugin to make it easier to consume XML REST APIs. The result is the ResponseFrom plugin. It's the opposite of this:  respond_to { |w| w.xml { render :xml => User.find_first } } […]


Yesterday Phil reminded me of an important feature that I had only half-implemented: condos. I finished that off today. The part I'm unsure about is how the map will handle them. I'm using Google's tabbed info windows, but those can only support three tabs. Yahoo! and I had a discussion about it a while back […]

REST Hacking

First off, many thank yous to Brian Del Vecchio for linking to MyNCRE from BostonWTF. It's an awesome idea and Brian's an awesome guy. Thanks!  In other news, I spent much of today hacking on a REST XML API. The good news: respond_to is awesome, as is render's :xml argument and especially ActiveRecord::Base's to_xml method. […]

MyNCRE is in production

I've flipped the switch and sent MyNCRE totally into production mode. I'm nervous, I'll admit. For months we had been developing in a half-production mode. The whole deployment on was in production, but the database settings were using the development database. Really, the only change I made today was changing over to the production […]


This is my work Web log. I need a separate blog than my personal one so that I don't confuse customers and clients with my posts about parties and live shows. If they want it, they can have it, but I'm not going to flaunt it. So, here's what I do for work: I write […]