Rails 4 2 compatibility

Fixes #34 and #49.

Tested with a fresh install of a Rails 4.2.0 app as a "standalone installation". Generated one resource and played around a bit and it seems to be working just fine.

I have not updated the dummy test app. It seems to be unused anyway...