[Fix] Added compatibility with new Rails 4.2 APIs

I've slightly modified the gem to use the new Rails 4.2 APIs.

This should fix issue #38.