ccuilla
2008-May-17 16:22 UTC
validates_numericality_of with greater_than* less_than* simply don''t work
It seems that the validations for: greater_than greater_than_or_equal_to less_than less_than_or_equal_to equal_to odd even Simply do not work (Rails 2.0.2). I''ve tried every combination I can think of and these never seem to fire. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
T K
2008-May-17 16:59 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
How exactly did you use it? Here''s a sample validates_numericality_of :attribute, :greater_than => 300 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 17:07 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
I''ve tried it multiple ways, including the very simplest like you''ve shown. Nothing seems to work. Here are two exact lines: validates_numericality_of :monthly_service_charge, :greater_than_or_equal_to => 0, :message => "must be greater than zero" validates_numericality_of :count_sheets_per_week, :greater_than => 0, :only_integer => true, :allow_nil => true, :message => "must be greater than zero" On May 17, 10:59 am, "T K" <tek.k...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> How exactly did you use it? > > Here''s a sample > > validates_numericality_of :attribute, :greater_than => 300--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
T K
2008-May-17 17:09 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
What''s the message you get? Have you tried in console? Did you have rails 2.0 installed? What''s your version of ActiveRecord then? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 17:21 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
I try to do model.valid? and I get true even though the values have been set to something invalid (like a negative number). Rails 2.0.2 How do I find the ActiveRecord version? On May 17, 11:09 am, "T K" <tek.k...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What''s the message you get? Have you tried in console? Did you have > rails 2.0 installed? What''s your version of ActiveRecord then?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
T K
2008-May-17 17:24 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
What do you see after running `gem list`? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 17:32 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
activerecord (2.0.2, 1.15.3) rails (2.0.2, 1.2.3) Is this the problem? I have an outdated ActiveRecord? On May 17, 11:24 am, "T K" <tek.k...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What do you see after running `gem list`?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 17:47 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
It looks like I have a few outdated things, but ActiveRecord is not among them: mongrel (1.0.1 < 1.1.4) actionwebservice (1.2.3 < 1.2.6) rake (0.7.2 < 0.8.1) net-sftp (1.1.0 < 2.0.0) gem_plugin (0.2.2 < 0.2.3) cgi_multipart_eof_fix (2.1 < 2.5.0) net-ssh (1.0.10 < 2.0.1) daemons (1.0.5 < 1.0.10) capistrano (1.4.1 < 2.3.0) fastthread (1.0 < 1.0.1) Unless there is something hidden in one of these. On May 17, 11:32 am, ccuilla <ccui...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> activerecord (2.0.2, 1.15.3) > rails (2.0.2, 1.2.3) > > Is this the problem? I have an outdated ActiveRecord? > > On May 17, 11:24 am, "T K" <tek.k...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > What do you see after running `gem list`?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 17:55 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
I might be onto something When I do a complete update of everything, actionwebservice triggers an update of activerecord from 1.15.3 to 1.15.6. We''ll see what happens after this. Bingo. That fixed it. Thanks for your help! I''ll know to keep my gems up to date now. On May 17, 11:47 am, ccuilla <ccui...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It looks like I have a few outdated things, but ActiveRecord is not > among them: > > mongrel (1.0.1 < 1.1.4) > actionwebservice (1.2.3 < 1.2.6) > rake (0.7.2 < 0.8.1) > net-sftp (1.1.0 < 2.0.0) > gem_plugin (0.2.2 < 0.2.3) > cgi_multipart_eof_fix (2.1 < 2.5.0) > net-ssh (1.0.10 < 2.0.1) > daemons (1.0.5 < 1.0.10) > capistrano (1.4.1 < 2.3.0) > fastthread (1.0 < 1.0.1) > > Unless there is something hidden in one of these. > > On May 17, 11:32 am, ccuilla <ccui...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > activerecord (2.0.2, 1.15.3) > > rails (2.0.2, 1.2.3) > > > Is this the problem? I have an outdated ActiveRecord? > > > On May 17, 11:24 am, "T K" <tek.k...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > What do you see after running `gem list`?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 18:15 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
I was wrong. After all of the updates it still isn''t working. :-( This is vexing and frustrating. I cannot even seem to get the debugger going to try and walk into things and see what''s happening. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-17 18:24 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
On 17 May 2008, at 19:15, ccuilla wrote:> > I was wrong. After all of the updates it still isn''t working. :-( > > This is vexing and frustrating.I just tried validates_numericality_of with greater_than and it worked fine. What are you doing (I saw some model definitions in a previous post of yours), what is the interaction with the model where it''s misbehaving? Fred> > > I cannot even seem to get the debugger going to try and walk into > things and see what''s happening. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ccuilla
2008-May-17 18:32 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
It seems that there was something in my project that was keeping it using an older version of rails. RAILS_GEM_VERSION = ''1.2.3'' unless defined? RAILS_GEM_VERSION I''ve commented that out. The project is now update to date. All gems are up to date. These validations now are working. But now rake test:units is failing with a "uninitialized constant CreateFeedbacks". This must be a different problem so I''ll keep digging. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
T K
2008-May-18 01:14 UTC
Re: validates_numericality_of with greater_than* less_than* simply don''t work
That''s simply because you created the app with rails 1.2.3. You need to upgrade to rails 2.0.2. What you have in gem and what you have in apps may be different. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- validates_numericality_of and greater_than* doesn't appear to be working
- At my wits end ! Controlling passed in negative values from a form
- validates_numericality_of, :allow_nil => true?
- validates_numericality_of positive integer
- validates_numercality_of with allow_nil.