This week’s report covers changes from 5th May 2008 to 11th May 2008 (the day the corresponding Rails Envy podcast was recorded).

script/dbconsole

A script/dbconsole script has been added that allows you to connect to your database using its console client.

If you needed to connect to your production MySQL database (you better know what you are doing!), for example, you can run RAILS_ENV=production script/dbconsole or simply script/dbconsole production (thanks to Ryan Bates for pointing this out!) and it will login to your database server using the command line MySQL client. This also works with the PostgreSQL and SQLite databases.

To use this script in your Rails app, remember to run rake rails:update:scripts after updating to edge Rails.

This nice little enhancement courtesy of Steve Purcell, who originally had a similar database console plugin.

Related changeset: http://github.com/rails/rails/commit/4a07103687084496b773e18a03b1f2f5e686f7ad

flash.now is now accessible in tests

This is something that many of us Rails developers have probably come across when writing tests for flash messages being set with flash.now, myself included. Basically, you couldn't test the contents of your flash.now because they were always being emptied before your test could get to them.

# In your controller:
flash.now[:notice] = 'You gotta be kidding me!'

# In your test:
assert_equal 'You gotta be kidding me!', flash.now[:notice]
# FAILS because flash.now[:notice] is nil

Andreas Neuhaus took a good look at how it works and figured out how to make testing flash.now work without resorting to assert_selects.

Related changeset: http://github.com/rails/rails/commit/74eed6290e63111d1aad2b181692a84f4f040aea

There isn't much else of note so far but if you'd like to know every gritty detail, you'd probably want to peruse the Rails commit logs. As always, let me know of any suggestions or how I can improve the Living on the Edge (of Rails) series.