One of the biggest tasks in our recent upgrade from Rails 2.2.2 to Rails 3.0.
45 at Bonanza was the
re-implementation of all of our Rails monkey patches custom initializers to work with Rails 3. This upgrade
presented a pleasant pattern (which we happily took as further validation of our move to Rails 3) of taking large, fragile patches
and re-implementing them as significantly smaller chunks of code - in many cases using public APIs now exposed by Rails.
In the case that spurred this post, we have some functionality implemented by subclassing some of our main controllers and
overriding a small subset of their methods. To alleviate the need to replicate view templates between the parent and child
controllers, we extended view template lookup to walk up the controller inheritance tree (up to
ActionController::Base) until a
particular view template could be found.