Fix from https://github.com/activescaffold/active_scaffold/issues/249