Updated active_record adapter to use modern query methods

Eliminating hordes of deprecation warnings in Rails 4, but breaks compatibility with Rails 2.