various changes to the generated code for rails from 4.0 beta to release.