Fix activerecord integration to work in rails >= 4.06

The method names have changed in activerecord.
Also see https://github.com/rails/rails/pull/11650
Merge pull request #3 from vollnhals/master

Fix activerecord integration to work in rails >= 4.06