#1033 ✓resolved

Integer property error?

Reported by malomalo | September 9th, 2009 @ 05:46 PM | in 0.10.0

Hey I have something weird happening. Maybe it is planned, but when I have a property that is an Integer and I create an object with the proptery as a random string and save the object it comes back with true and the property has been set to nil. Shouldn't it throw an error or when I have validations put it in the error messages?

Comments and changes to this ticket

  • malomalo

    malomalo September 9th, 2009 @ 06:03 PM

    Same goes for Floats


    require 'dm-validations'

    class MyClass
    include DataMapper::Resource

    property :elevation, Integer property :latitude, Float, :precision => 15, :scale => 10, :nullable => false end

    MyClass.new(:elevation => 'elvation', :latitude => 'invalid').save => true

    actually on second thought what might be happening is .to_i is returning 0

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) September 10th, 2009 @ 11:11 AM

    • Milestone set to 0.10.0
    • State changed from “new” to “resolved”
    • Assigned user set to “Dan Kubb (dkubb)”

    I can confirm this is no longer an issue on DM 0.10 (currently at RC2, but final will be released next Tuesday)

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