support activerecord 4