We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
On rails 3, using SQLite:
Given the following class
class Item < ActiveRecord::Base acts_as_nested_set default_scope order("lft") end
Then creating new items invalidates the tree.
This is because the default scope is included in the set_default_left_and_right scope, which breaks the calculation.
Here's my current work around:
class Item < ActiveRecord::Base ... protected def set_default_left_and_right Item.unscoped do super end end end
The text was updated successfully, but these errors were encountered:
What can we do to fix this in the core?
Sorry, something went wrong.
I had similar problem with using rebuild! function and having default_scope order("position asc") declared in my model. I've fixed it with adding
rebuild!
default_scope order("position asc")
def rebuild!(validate_nodes = true) unscoped do #method code here end end
Fixed rebuild! when there is default_scope with order declared
a68725d
* Also added test for rebuild! action * Fixes #165 * Fixes #91
No branches or pull requests
On rails 3, using SQLite:
Given the following class
Then creating new items invalidates the tree.
This is because the default scope is included in the set_default_left_and_right scope, which breaks the calculation.
Here's my current work around:
The text was updated successfully, but these errors were encountered: