Fix compatibility under Rails 3.1 and activerecord-jdbc-adapter 1.3.x