-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
self_and_ancestors - need for reload of model #68
Comments
I can't reproduce your issue on either Rails 3.2 or Rails 4.0: ~/code/closure_tree (master) $ DB=mysql irb -I "lib:spec"
irb(main):001:0> require 'spec_helper'
irb(main):002:0> t = Tag.create(:name => 'hello')
=> #<Tag id: 1051683930, name: "hello", title: nil, parent_id: nil, sort_order: nil, created_at: "2013-07-20 09:22:45", updated_at: "2013-07-20 09:22:45">
irb(main):003:0> t.self_and_ancestors.to_a
=> [#<Tag id: 1051683930, name: "hello", title: nil, parent_id: nil, sort_order: nil, created_at: "2013-07-20 09:22:45", updated_at: "2013-07-20 09:22:45">] If I had to guess, you've got a validation that reads |
I thought about this more, and realized that if you reparent a node, the |
that's good, thanks! |
Fixed in v4.2.7. Tell me how things go! |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi, it is quite counterintuitive, that 'self_and_ancestors' doesn't see changes to node until reload. Is it targeted behaviour and I should use reload in methods, which use these types of scopes?
The text was updated successfully, but these errors were encountered: