changed for active_record 4 support