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
It seems to me that the ancestry column has to be included in attr_accessible. If it is not, the update_descendants_with_new_ancestry will fail, as it uses update_attributes to set the new ancestry.
Was this done on purpose? I would prefer that my users do not have direct access to that column but use special setters for reordering items, in order to more easily control what and where to they can move stuff.
The text was updated successfully, but these errors were encountered:
In my fork at http://github.com/hennk/ancestry I changed all updates to the ancestry column to use update_attribute, which ignores protected attributes.
Btw, I had some problems getting the tests to run. I created a new rails app, created a git checkout in vendor/plugins and tried to run the test but it always complained that the "has_ancestry" method was unknown.
In the end I had to change the plugin's init.rb to change the load path and require it from has_ancestry_test.rb, and use the mysql adapter. Any tips on how to do this without those hacks?
I fixed the brittle test suite and it is now easy to check out the repo and run the tests against multiple databases and versions or AR. I will look into the assignment issue shortly.
It seems to me that the ancestry column has to be included in attr_accessible. If it is not, the update_descendants_with_new_ancestry will fail, as it uses update_attributes to set the new ancestry.
Was this done on purpose? I would prefer that my users do not have direct access to that column but use special setters for reordering items, in order to more easily control what and where to they can move stuff.
The text was updated successfully, but these errors were encountered: