skyeagle / nested_set

Rails 3 support! An awesome replacement for acts_as_nested_set and better_nested_set.
MIT License
170 stars 24 forks source link

depth column not automatically defaulting to 0 #13

Closed jrmurad closed 13 years ago

jrmurad commented 13 years ago

Having a depth column in my migration was causing my code to break in various ways unless I specified ":default => 0" [like your test schema... this is why they pass] for the database migration's depth column or I did "self.depth ||= 0 if has_attribute?(:depth)" after_initialize in my model.

Perhaps this could be documented under Usage or you can have to code default the depth to 0.

Thanks!

skyeagle commented 13 years ago

Thanks. I'll look it later. You can delete the depth column at the moment. There is no reason to use it. If you need a level try to use each_with_level. It doesn't have overhead to calculate level.

skyeagle commented 13 years ago

It was fixed in 1.6.4 release. Thanks.