Skip to content

Instantly share code, notes, and snippets.

@denysonique
Created April 24, 2012 21:18
Show Gist options
  • Save denysonique/2483897 to your computer and use it in GitHub Desktop.
Save denysonique/2483897 to your computer and use it in GitHub Desktop.
DataMapper Postgres local connection
require 'data_mapper'
require 'dm-postgres-adapter'
DataMapper.setup(:default, 'postgres:///foobar')
class Foo
include DataMapper::Resource
property :id, Serial
property :bar, String
end
DataMapper.finalize
DataMapper.auto_upgrade!
Foo.create(bar: 'a bar')
puts Foo.all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment