Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Support for infinity from database in validates_numericality_of

#2780

After this patch was accepted

#354 Allow Infinity to pass validates_numericality_of

infinity was partly supported by validates_numericality_of. However, if the infinity (or nan for that matter) stems from the database, the validation would fail. That leads to the rather interesting cases where the model is successfully saved, but a reloading and saving again fails because of validates_numericality_of. I have create a patch that solves the issue. (attached).

Note that support for infinity in the database is broken, at least for postgresql; I will create an issue an attach a patch for this later.

Reported by Esben Mose Hansen · June 8th, 2009 @ 08:49 AM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to incomplete

    Hey Esben,

    The patch is missing tests.

    Thanks!

    August 9th, 2009 @ 10:02 PM

  2. Pratik
    Pratik
    • Assigned user set to josh

    August 9th, 2009 @ 10:02 PM

  3. josh
    josh
    • Assigned user cleared.

    August 19th, 2009 @ 03:56 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  5. Dan Pickett
    Dan Pickett
    • Tag changed from infinity, nan, patch to bugmash, infinity, nan, patch

    May 9th, 2010 @ 07:28 PM

  6. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open
    • Importance changed from to

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:39 PM

  7. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:39 PM