Skip to content

Instantly share code, notes, and snippets.

@ku1ik
Created June 5, 2010 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ku1ik/426546 to your computer and use it in GitHub Desktop.
Save ku1ik/426546 to your computer and use it in GitHub Desktop.
require "bundler"
Bundler.setup
require "dm-core"
require "dm-types"
require "dm-migrations"
DataMapper.setup(:default, "mysql://localhost/test")
class User
include DataMapper::Resource
property :id, Serial
property :status, Enum, :flags => [:new, :old], :default => :new
auto_migrate! # BOOM! "Invalid default value for 'status' (DataObjects::SQLError)"
# same for Flag
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment