Search

Friends

Atomspheric CO2 (PPM)

Archives

Blather

Uptime verified by Wormly.com

6 May 2010

ArgumentError: comparison of Fixnum with nil failed

Using acts_as_nested_set in ruby and something like taxon.move_to_child_of(parent) you can get this error if your table data is incomplete. You may have functioning nesting through the chain of parent IDs but you need the left and right fields as well. If either the left or right field is null you will get an error like this one for certain move operations. This can easily happen if you've created some dodgy fixtures for instance.

Trying using Taxon.rebuild! to repair the table.

Comments

  1. Hello Ryan.. Hope you’re doing well… The feed doesn’t seem to be updating. (Nor is the side comment bar active) …

    andrew / 12:03pm / 10 May 2010

  2. Hopefully that fixed it. At least temporarily.

    Ryan / 1:19pm / 10 May 2010

  3. It might be fixed properly now. Although not the chat part. I should sort that out.

    Ryan / 1:19pm / 10 May 2010

  4. Chat is fixed now too.

    Ryan / 1:29pm / 10 May 2010

  5. Helped me a lot 2 years later and using another gem awsomenestedset

    Rogério / 4:28am / 9 November 2012

  6. Thank you!

    Sebastian / 5:36pm / 29 August 2013

Leave a comment

Markdown

0.092 seconds