Fixed a bug related to instance variables in child classes in Rails 3.