a simpler solution to #523 rails 3 compat