ActiveRecord Golf

So I was messing around with some scratchpad code today, investigating the use of with_exclusive_scope, and here’s what I had to write to come up with a minimal working ActiveRecord model:

require 'rubygems'
require 'active_record'

ActiveRecord::Base.establish_connection(
  :adapter => "sqlite3",
  :database => ":memory:")

ActiveRecord::Base.connection.create_table(:monsters) do |t|
  t.string :name
end

class Monster < ActiveRecord::Base
end

cm = Monster.create(:name => "Cookie Monster")

For little one-off demo scripts that seems a bit excessive to me. For comparison, here’s the equivalent DataMapper:

require 'rubygems'
require 'datamapper'

class Monster
  include DataMapper::Resource

  property :name, String, :key => true
end

DataMapper.setup(:default, 'sqlite::memory:')
DataMapper.auto_migrate!

cm = Monster.create(:name => "Cookie Monster")

Can anyone golf the ActiveRecord down any smaller?

EDIT: Thanks to Jacob Rothstein for this version:

require 'active_record'

class Monster < ActiveRecord::Base
  establish_connection :adapter  => 'sqlite3',
                       :database => ':memory:'

  connection.create_table( :monsters ) { |t| t.string :name }

  cm = create :name => 'cookie monster'
end