Adding support for activerecord 4.