Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phatmann/208625 to your computer and use it in GitHub Desktop.
Save phatmann/208625 to your computer and use it in GitHub Desktop.
require 'rubygems'
gem 'dm-core', '0.10.1'
require 'dm-core'
DataMapper::Logger.new(STDOUT, :debug)
DataMapper.setup(:default, "mysql://localhost/ts_test")
class Sample
include DataMapper::Resource
property :id, Serial
property :num, Integer
end
DataMapper.auto_migrate!
s = Sample.create(:num => "")
# -> DataObjects::SQLError: Incorrect integer value: '' for column 'num' at row 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment