-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible missing results #15
Comments
Hey there, I can't reproduce your issue -- see 7d6a7a2...798a56d and http://travis-ci.org/#!/mceachen/closure_tree/builds/2239812 Can you edit that new test to be more like your setup, and make it fail? Thanks. |
(I'm happy to re-open this issue if you can write a test that reproduces your bug, or explains your problem better) |
Hi there, I run a console, and I create a father object, lets call him {parent}. If i call the parent method on {child} i'll receive {parent}, everything looks fine. But if i call child.self_and_ancestors I expected smth like [ {child}, {parent} ] instead of [] |
OK, I see. I've changed my test to do what I think you're doing. Could you please look at it and see if you're doing something different? Because if you pass in the parent to the constructor, that works just as well as |
OK, I figured it out. You're calling the constructor with a :parent attribute, which wasn't marked explicitly as attr_accessible. I've updated acts_as_tree.rb to set this automatically. If you upgrade to v3.4.0, things should work for you. |
Ok, that sounds great! Thx for the help 2012/9/2 Matthew McEachen notifications@github.com
Manu |
Mantero: Don't use v3.4.0. Use v3.4.1, as Bhavin found that in v3.4.0 I had switched mysql development dependencies to incorrectly include all the database gems that' we're compatible with. |
Hi, I was working with Closure-tree gem and I noticed this
1.9.3p194 :019 > m.self_and_ancestors
=> [# CuisineType id: 27, name: "m", parent_id: 22 ]
so we have "m" with a parent... not in the list
1.9.3p194 :020 > m.parent
=> # CuisineType id: 22, name: "e", parent_id: nil
For me, the "logic" behaviour should be smth like
console > m.self_and_ancestors
=> [# ...m..., #...e...]
At least I've resolved it creating my own function (recursive simple one). I've posted it just for "help the developers if it were really a bug"
Apart from that the gem is sooo nice ^^
Manu
The text was updated successfully, but these errors were encountered: