You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently migrating from awesome_nested_set to this beautiful gem and I noticed that #root for an entry returns nil until the record got saved even if a parent is set.
My current workaround (but I don't know if it breaks anything):
has_closure_tree# MUST BE AFTER attr_accessible/self.table_name=# fix root being nil until persisteddefrootsuper || (parent && parent.root)end
The text was updated successfully, but these errors were encountered:
Sorry for the response delay--I agree that your assumption of how .root() should work, and would welcome a pull request. Please include a test against saved and unsaved model instances.
FWIW I think this would warrant a major version increment, and I'm completely fine with that.
I'm currently migrating from awesome_nested_set to this beautiful gem and I noticed that
#root
for an entry returns nil until the record got saved even if a parent is set.My current workaround (but I don't know if it breaks anything):
The text was updated successfully, but these errors were encountered: