Fixnum problem

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…

Manish B. 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

On Sun, Mar 7, 2010 at 12:04 PM, Manish B.
[email protected]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.

On Sun, Mar 7, 2010 at 1:15 PM, Manish B. [email protected]
wrote:

You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected][email protected]
.
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)

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?

On Mar 7, 7:15 pm, Manish B. [email protected] 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs