Joe MooreJoe Moore
Standup 06/23/2009: Multi-table Inheritance?
edit Posted by Joe Moore on Tuesday June 23, 2009 at 04:29PM

Ask for Help

"Has anyone implemented mutli-table (class table) inheritance in Rails, as apposed to single table inheritance (STI)?"

  • There are some plugins that nobody has tried, such as inherits_from
  • What about a view to represent the super set of tables and rows?

"We're looking for a dead-simple, drop-in JS rating or 'starting' plugin."

Check out the start-rating jQuery plugin. Any other suggestions?

Joe MooreJoe Moore
DRY, Targeted, and Reusable Testing of ActiveRecord Extensions
edit Posted by Joe Moore on Wednesday March 18, 2009 at 08:39PM

At Pivotal, we are passionate about test driven development, keeping things DRY, and writing readable and understandable code. Satisfying all of these desires can be challenging, especially when writing test code. In particular, ActiveRecord extensions present several challenges: which models using an extension should we test? How do we both test our extension in isolation while also testing all model's usage of that extension? Is it even worth it?

The answer is yes, it is worth it, and it's also fairly easy, readable, understandable, and DRY. I will present both a common problem and a solution, using a cumulation of technologies and techniques from multiple Pivotal projects, in particular using acts_as_fu to create laser-targeted, isolated, and disposable ActiveRecord models for testing extensions and RSpec shared behaviors to minimize the amount of duplicated test code.

Joe MooreJoe Moore
Standup 1/27/2009: Nested Model Forms Soon
edit Posted by Joe Moore on Tuesday January 27, 2009 at 05:58PM

Interesting Things

  • application.rb vs. application_controller.rb: As we all know, ApplicationController breaks with Rails convention and lives in the application.rb file, not application_controller.rb. Be careful if you create an application_controller.rb file of your own, as this can confuse Rails class loading and might result in Rails deciding not to load application.rb.

  • Google Webmaster Tools: Note that if you are using Google Webmaster Tools that statistics are different for www.example.com and example.com (sans www).

  • Nested Model Forms are coming in Rails 2.3! There is even a patch in progress.