Skip to content
This repository

Saving left 0 padded strings (e.g. "030") as integers cause saving to fail silently #228

Open
endoscient opened this Issue · 1 comment

2 participants

endoscient Felix Jankowski
endoscient
class Foo
  include DataMapper::Resource  
  property :id, Serial
  property :number, Integer
end

f = Foo.new({ :number => "030" })
f.valid? # true
f.save # false
f.errors # {}

Using latest released version of everything, with sqlite adpator.

Solution. Either have it return a validation error, or parse the string to an integer.

Felix Jankowski
FeeJai commented

I am still having this error. is there a solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.