I\'m in the process of upgrading an application to Rails 3. I\'ve decided to go with the mysql2 gem. There\'s some legacy code in the app that makes calls like:
If you just want to reuse the database.yml configuration, you can do this:
config = ActiveRecord::Base.configurations[RAILS_ENV].symbolize_keys
conn = Mysql2::Client.new(config)
conn.query("select * from users").each do |user|
# user should be a hash
end