Makes activerecord dependency Rails 4 compatible