fix incompatibilities with rails 3.0 and 3.1 in preparation for upgrade