Archive for the ‘Uncategorized’ Category
An example of how to do a Ruby DSL with nested blocks and no block params required
Posted: December 15, 2011 by Steve in UncategorizedTags: programming, ruby
Have you ever wondered how those DSL’s in ruby managed to get rid of the requirement to pass a variable to a block to indicate the context of the enclosed block? An example of this in Rails route definitions where the blocks are simply just nested. My question was how does each block know what […]
About 5 weeks ago I mentioned to a friend of mine that my fantasy football team was a team without a weakness. I was undefeated, leading the league in points, and firing on all cylinders. He said to be careful, as he had just won his fantasy baseball league over a team like that. That […]
Today I did something that sounds illegal, but actually wasn’t. You see I had a programming issue that was perplexing me and didn’t require a lot of typing. I had an opportunity to drive the slow way from downtown St. Paul to uptown Minneapolis and think about my problem. With some black rebel motorcycle cycle […]
Notice the drowning man in the orange destined for to drown in the Thanksgiving wassail
Mozilla-Knight Foundation – People Powered News Challenge Entry
Posted: June 6, 2011 by Steve in UncategorizedTags: ideas, journalism, mozilla
The main ingredient missing in our current news system is the systematic pursuit of truth. It is riddled with attempts to distract, obscure, mislead and confuse the public. The reasons are many and varied, but my thesis is centered on the idea that the powers that own or control the media have no interest in […]
The following post was going to be my submission to the Mozilla-Knight Foundation challenge for People Powered News, until I realized that the limit was 500 words. My next posting was my actual submission. Background I follow Jay Rosen and Dave Winer and love their take on a new news system and how it might […]
Rails upgrade from 2.3.5 to 2.3.11 breaks serialization through accepts_nested_attributes_for
Posted: June 3, 2011 by Steve in UncategorizedThis may not be a common pattern in rails applications, but a recent change in activerecord (somewhere between 2.3.5 and 2.3.11) code broke the following scenario: class LineItem < ActiveRecord::Base before_validation :build_visual_attributes attr_writer :color, :height, :width # the components of visual attributes serialize :visual_attributes attr_accessible :quantity, :cost def build_visual_attributes write_attribute(:attributes, {:color => color, […]