Skip to content

Instantly share code, notes, and snippets.

@revelation
Created July 31, 2008 02:40
Show Gist options
  • Save revelation/3393 to your computer and use it in GitHub Desktop.
Save revelation/3393 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'dm-core'
class Zoo
include DataMapper::Resource
property :id, Serial
end
DataMapper.setup(:default, 'sqlite3::memory:')
DataMapper.setup(:secondary, 'sqlite3::memory:')
DataMapper.auto_migrate!
repository(:secondary) {
DataMapper.auto_migrate!
}
repository(:default) do
Zoo.create
end
repository(:secondary) { |r| puts Zoo.first(:repository => r).inspect }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment