On Tue, Mar 30, 2010 at 11:13 PM, Jeremy Woertink <[email protected]> wrote:

> NoMethodError (undefined method `<=>' for #<Listing:0x2aaaae156e08>):
>
> This happens even in the console when I try to create a new Listing
> object and save it.
>
>>> l = Listing.new
>>> l.name = "test"
>>> l.save
> NoMethodError: undefined method `<=>' for #<Listing:0x2b9595d76350>

Something's trying to compare 2 Listing objects, which don't have any
such comparison method, apparently.

>> a = Object.new
=> #<Object:0x1016b0498>
>> b = Object.new
=> #<Object:0x1016ac848>
>> a <=> b
NoMethodError: undefined method `<=>' for #<Object:0x1016b0498>
        from (irb):22
>>

Unlike, say:

>> Integer.respond_to?("<=>")
=> true
>> 4 <=> 5
=> -1
>> 5 <=> 4
=> 1

So you need to find where that comparison is being made -- since it's
on save possibly some validation?

HTH,
-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to