This project is archived and is in readonly mode.
validates_numericality_of does not work with negative values
-
Rohit Arondekar
- State changed from new to invalid
- Importance changed from to Low
Can you please upgrade to Rails 3 Beta 4? I cannot reproduce this in Rails Master on 1.9.2.
I've closed this ticket, but if it's still an issue after upgrading then just leave a comment and I'll reopen it. :)
-
Nico Schottelius
Also fails for beta4:
Entering -34 and it validation "works".
-
Nico Schottelius
And here's the full version blob:
[14:47] kr:rdb% rails --version Rails 3.0.0.beta4 [14:57] kr:rdb% bundle show Gems included by the bundle: * abstract (1.0.0) * actionmailer (3.0.0.beta4) * actionpack (3.0.0.beta4) * activemodel (3.0.0.beta4) * activerecord (3.0.0.beta4) * activeresource (3.0.0.beta4) * activesupport (3.0.0.beta4) * arel (0.4.0) * builder (2.1.2) * bundler (0.9.26) * erubis (2.6.6) * i18n (0.4.1) * mail (2.2.5) * mime-types (1.16) * polyglot (0.3.1) * rack (1.1.0) * rack-mount (0.6.6) * rack-test (0.5.4) * rails (3.0.0.beta4) * railties (3.0.0.beta4) * rake (0.8.7) * sqlite3-ruby (1.3.0) * thor (0.13.7) * treetop (1.4.8) * tzinfo (0.3.22) [14:57] kr:rdb%Edited by Rohit Arondekar for formating.
-
Rohit Arondekar
- State changed from invalid to open
I'm pretty sure this is fixed in Rails master. But still opening ticket.
Can somebody please try and reproduce this?
-
Miles Egan
I haven't been able to reproduce this in beta4 or master.
-
Subba
- Assigned user set to Rohit Arondekar
i am unble to reproduce this in beta4.
can we resolve this ticket.class Newspaper < ActiveRecord::Base set_table_name :papers set_primary_key :paper_id validates_numericality_of :paper_size, :greater_than_or_equal_to => 0, :only_integer => true def self.lab Newspaper.create!(:paper_size => -2) end end -
Rohit Arondekar
Nico, is there anything else that needs to be done to reproduce this issue?
-
Nico Schottelius
As lighthouse does not accept my mail reply, here's a 1:1 copy:
Subba updated this ticket at July 16th, 2010 @ 09:33 PM
i am unble to reproduce this in beta4. can we resolve this ticket.
Strange, it works fine in a brand new application with beta4.
Will have to debug what's wrong in the existing application.
Just close the ticket.
Edited by Rohit Arondekar for formating.
-
Rohit Arondekar
- State changed from open to invalid
Nico, no problem. Please do update the ticket if it turns out to be a rails issue and I'll reopen the ticket.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.