Created
September 10, 2009 19:03
-
-
Save baroquebobcat/184741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Either datamapper or data objects has some weird behavior on jruby. | |
# When an empty text field comes before an integer field in a select, | |
# the integer field is clobbered. | |
require 'yaml' | |
require 'rubygems' | |
require 'dm-core' | |
class A | |
include DataMapper::Resource | |
property :id,Serial | |
property :txt,Text | |
end | |
DataMapper.setup :default,"mysql://root@localhost/testing" | |
DataMapper.auto_migrate! | |
A.create :txt=>'no clobbering time' | |
A.create | |
puts repository(:default).adapter.query('SELECT txt,id from `as`;').to_yaml | |
#from jruby | |
#--- | |
#- !ruby/struct:#<Class:01x40395aaf> | |
# txt: no clobbering time | |
# id: 1 | |
#- !ruby/struct:#<Class:01x40395aaf> | |
# txt: | |
# id: << ???? | |
#MRI interpreter | |
#--- | |
#- !ruby/struct: | |
# txt: !str:Extlib::ByteArray no clobbering time | |
# id: 1 | |
#- !ruby/struct: | |
# txt: | |
# id: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment