-
Notifications
You must be signed in to change notification settings - Fork 243
Prevent name collision with other gems: allowing the use of has_closure_tree
method besides acts_as_tree
#130
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
Conversation
has_closure_tree
beside method besides acts_as_tree
has_closure_tree
method besides acts_as_tree
LGTM. We may want to add a caveat that other hierarchical gems won't place BTW, what are you missing from ancestry?
|
I think the gem he is using depend on ancestry. |
looks good 👍 |
Indeed that is the case: a dependency of my app uses ancestry. |
@mceachen I updated the README doc. |
@mceachen increased language strength in the warning section of the README as requested :) |
@mceachen anything else I can do, or is it ready to be merged? :) |
Please squash your commits. |
…ure_tree` beside method besides `acts_as_tree`
4bce868
to
fbc8653
Compare
@seuros squashed |
Prevent name collision with other gems: allowing the use of `has_closure_tree`method besides `acts_as_tree`
@eturino Thank you 💚 |
Scenario: one of your dependencies uses other gem like Ancestry, while you want to use this gem for its multiple benefits. Even if that dependency uses the
has_ancestry
method instead of theacts_as_tree
method, it will overwrite ClosureTree's acts_as_tree, render it useless. If we can still use another method likehas_closure_tree
, we can still work with this.This way, the user can choose between using
has_closure_tree
(more intention revealing name in terms of what tool we want to use, IMO) or the genericacts_as_tree
as before.I changed one of the models of the specs to use the
has_closure_tree
method while leaving the rest using theacts_as_tree
method to ensure that everything keeps working as expected.