Add activerecord4 support

Please let me know if I need to make any tweaks!