#1035 ✓resolved
Nick

jruby: text fields that precede integer fields clobber their values

Reported by Nick | September 10th, 2009 @ 02:20 PM

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

Update
It also happens with string properties.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages