Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def set_geom self.update_attributes(:the_geom=>ActiveRecord::Base.connection.execute("ST_PointFromText('POINT(' || #{self.lng}|| ' ' || #{self.lat} || ')',4326);") self.update_attributes(:neighborhood_id=>ActiveRecord::Base.connection.execute("SELECT neighborhoods.id FROM neighborhoods, items WHERE ST_Contains(neighborhoods.the_geom,self.the_geom);") end
This paste will be private.
From the Design Piracy series on my blog: