Sir can i know what is the meaning of the phrase ''comparison of Fixnum with nil failed'' I want to pass two parameters to a method in a model file.. bt wen i pass an integer then it gives the above error.. Please help.. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Manish Belsare wrote:> Sir can i know what is the meaning of the phrase ''comparison of Fixnum > with nil failed'' > > I want to pass two parameters to a method in a model file.. > bt wen i pass an integer then it gives the above error.. > Please help..Sounds like an Enumerable error. $ irb [nil, 1].max ArgumentError: comparison of Fixnum with nil failed -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Mar 7, 2010 at 12:04 PM, Manish Belsare <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> Sir can i know what is the meaning of the phrase ''comparison of Fixnum > with nil failed'' > > I want to pass two parameters to a method in a model file.. > bt wen i pass an integer then it gives the above error.. > Please help.. <http://www.ruby-forum.com/>One of your numbers doesn''t have a value, it is nil. Is nill more than 1? Less than 1? Is it more than 1000? Less than 1000? It doesn''t make sense to compare nil to a number, so, for example, the code "1 < nil" will raise "ArgumentError: comparison of Fixnum with nil failed" You need to figure out which parameter was nil, how it got that way, and what you need to do in this situation. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sir i have now tried to declare a same method twice with a different name but the same parameter to both the methods.. Bt i still get that fixnum problem.. i want to know that calling two different name methods in on Model file works.? how to resolve that error? -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Mar 7, 2010 at 1:15 PM, Manish Belsare <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Sir i have now tried to declare a same method twice with a different > name but the same parameter to both the methods.. > Bt i still get that fixnum problem.. > i want to know that calling two different name methods in on Model file > works.? > how to resolve that error? > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >Changing the name won''t fix the problem in your code. Post the code for the method (or look to see where your params are compared) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 7, 7:15 pm, Manish Belsare <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Sir i have now tried to declare a same method twice with a different > name but the same parameter to both the methods.. > Bt i still get that fixnum problem.. > i want to know that calling two different name methods in on Model file > works.? > how to resolve that error?Look at the backtrace and try and figure out (perhaps using the debugger) what is nil when it shouldn''t be Fred> -- > Posted viahttp://www.ruby-forum.com/.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.