saks / mongoid_acts_as_tree

ActsAsTree for Mongoid
http://github.com/ramdiv/mongo_mapper_acts_as_tree
MIT License
32 stars 17 forks source link

descendants method fixed #6

Closed tchukuchuk closed 13 years ago

tchukuchuk commented 13 years ago

I've fixed descendants method which doesn't work for me if self.instance_variable_get(:@new_record) returns nil and not false.

saks commented 13 years ago

Can you provide some more info? This workaround was to return empty array for models that haven't @new_record variable. Your patch breaks this behavior and if @new_record is nil (i.e. model not fully initialized yet) plugin will try to find it's descendants.

tchukuchuk commented 13 years ago

here is my issue : https://gist.github.com/740709

saks commented 13 years ago

Thanks a lot. I'll check this and find solution.

saks commented 13 years ago

This strange behavior of mongoid was already fixed in this commit so i will revert this commit.

I've checked your gist and it looks like there is no any issues.

Thank you for help!