similar to: validates_numericality_of with greater_than* less_than* simply don't work

Displaying 20 results from an estimated 3000 matches similar to: "validates_numericality_of with greater_than* less_than* simply don't work"

2008 May 11
0
validates_numericality_of and greater_than* doesn't appear to be working
I''m using Rails 2.0.2 and I have been trying to take advantage of the "validates_numericality_of" with the ":greater_than" option with something like this: validates_numericality_of :users, :greater_than => 0, :only_integer => true, :allow_nil => true, :message => "The number of allowed users must be a whole number greater than zero." But this
2009 Jun 24
2
At my wits end ! Controlling passed in negative values from a form
Hi, I am trying to validate a numeric value passed in from a form, which is saved in a MySQL db as decimal(9,2) Now problem is I need to ensure people don''t enter a form value like -. 003. In my validations, I have a validates_numericality_of check being done. Furthermore, in validate method, I have a check using an if statement such as : ((an_object[n].nil? or an_object[n] < 0) and
2006 Apr 03
4
validates_numericality_of, :allow_nil => true?
Is there a way to use validates_numericality_of and still allow null values? I have a model with some optional values that can be nil, but if they''re present, they must be numbers. Will I need to construct a custom valiation for this, or is there some method built in? Seems like it would be a common enough need. Jeff -- Posted via http://www.ruby-forum.com/.
2006 Jan 19
7
validates_numericality_of positive integer
Hi, What is the simplest way to validate a positive integer? validates_numericality_of :foo, :integer_only => true how do I add the positive part? Do I need another validation statement for pattern matching or do I have to write a validate() funciton for my model? Thanks, Peter
2011 Jun 19
10
validates_numercality_of with allow_nil.
In the model I have: validates :square_meters_public_land, :barrier_meters, :numericality => { :greater_than_or_equal_to => 0 }, :allow_nil => true but if, in the field, on create, I don''t insert a value I have the error "field is not a number". -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To
2008 Apr 04
6
validates_numericality_of :not_equal_to
I have a situation in which I want to validate a number is not zero. Both positive and negative values are acceptable, just not zero. validates_numericality_of has an :equal_to attribute, but I don''t see a :not_equal_to. I have not yet been able to find anyone who has discussed this. I did find information about custom validators, so I am now using a custom validator to check the field
2007 Nov 03
3
Birthdate validation
Hello everyone, I''m almost cracking my head trying to do this birthdate validation. It turns out that I can only accept users with at least 18 years old and I''m trying to validate it writing this code on my user.rb fil at app/ models class User < ActiveRecord::Base validates_presence_of :full_name validates_presence_of :street_address validates_presence_of :city
2005 Aug 21
8
validates_numericality_of
As far as I can tell "numericality" is not a word. Maybe this method should be renamed. -- R. Mark Volkmann Partner, Object Computing, Inc.
2008 Mar 08
9
Newbie worries with "Developing Rails Applications on Max OSX Leopard"
Hello There, As a new comer to RoR, I started to follow the article http://developer.apple.com/tools/developonrailsleopard.html. In short you create to entities and one one-to-many relation linking them. Everything was good until the establishment of the relation. I am unable to go any further than "Linking Models Together" : I can create the "vendors" mentionned in the
2008 Oct 02
1
acts_as_taggable_on environment issues
Like most people, I''ve got two machines: one for development and one for production. I''ve done everything I can to make sure the ruby/rails environments are the same, but of course they''re not identical (I''ll get into that in a moment). The error that I''m getting happens when I call a method in a background task controller on the production machine; I
2008 Mar 28
0
Patch review request: validates_numericality_of does not replace option in custom message like in default message
Hi, Today someone created a ticket for a defect in validates_numericality_of, at first sight i thought it wasn''t a defect but an enhancement. But then i found that validates_length_of accepts :message => "should be greater than %d", but validates_numericality_of doesn''t (The output for v_n_o is: "should be greater than %d" instead of "should be
2008 Feb 12
0
Validate all model fields with validates_numericality_of
hi, I have a rather big table and i need to validate every decimal field in the table to make sure its numeric. Can anyone think of the best way to do this or is it even possible? I dont want to write validates_numericality_of: and then each field in the table seperately. JB -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this
2006 Mar 01
6
Dtrace not working for processes running after a couple of hours
Hi, all, I''m a newbie on dtrace and the problem I am having is: For processes which have been running for more than a couple of hours, dtrace doesn''t seem to be able to trace(I waited for at least one hour and didn''t see anything happening). However, it works every time for a relatively new process. Any insight or help will be appreciated. This is my machine:
2010 Jul 22
2
Dsync ignores INBOX when converting from mbox to maildir
Hi, I am trying to convert email box in mbox format to maildir++. It converts all folders except INBOX. For example: dsync -D -v -f -u 'info at example.org' mirror 'maildir:~/Maildir' prints: dsync(info at example.org): Info: Sport: only in source So it converts Sport folder, but INBOX folder is ignored. dovecot.conf contains: mail_location = mbox:~/mail:INBOX=/var/mail/%u
2006 May 31
1
ActiveRecord: When / where to validate data? Tricky question
First of all, thanks for you time. I have kind of a tricky question and wanted to see what you guys thought. ------------------------------------------- Lets say I have this: ------------------------------------------- class Purchase < ActiveRecord::Base validates_numericality_of :some_number, :only_integer => true end ------------------------------------------- Then I do this:
2007 Sep 17
2
mongrel_rails hang and does not respond
Hello, I''ve install ror/mongrel etc, etc on a linux server (rhes). As i''m not root, all package startinf from ruby have been install into ~/gconf/usr ruby-1.8.6 and all of this gem package: -r-xr--r-- 1 dimnce dba 168448 Aug 9 14:53 rails-1.2.3.gem -r-xr--r-- 1 dimnce dba 84480 Aug 9 14:56 rake-0.7.3.gem -r-xr--r-- 1 dimnce dba 217088
2006 Jun 21
3
validation help
I would like to validate a number within a certain range. To first test that a entry is a valid number i use validates_numericality_of :my_number, :message =>''sorry, not a number'' to test if the number is within a certain range i use validates_inclusion of :my_number, :in => min..max, message => ''outside range!'' If the numericality test fails, I
2006 Jun 19
3
newbie validation
hi there. Here is the simple scenario: My active record connects to a table that contains an integer field. My form contains a text box that allows me to enter a value to get updated to the integer field. If anything gets entered that is anything other than a POSITIVE INTEGER, I want to display an error. I have noticed that if I create a new active record like @record =
2006 May 22
4
How to check an input String is a number or not in ruby?
How to check an input String is a number or not in ruby? Thanks in advance, Joshua -- Posted via http://www.ruby-forum.com/.
2017 Apr 11
3
Require help on removing SAMBA
Hi Team, Can you please guide us to remove SAMBA 3.0.24 completely from our SOLARIS Server as we don't require it anymore ? Thanks, Suganthi