support ActiveRecord 4

Create adapter both work with AR3 and AR4.