Coder Social home page Coder Social logo

Comments (5)

jims avatar jims commented on June 14, 2024

I also have this issue. The thing is that because you never know the load order of a plugin that adds the acts_as_tree method. Because of this, using respond_to?(:acts_as_tree) will probably fail to detect such plugins/gems.

I forked the rep and added a check for the ActsAsTree module instead. This fixes the problem only if you're using a plugin that defines the module ActsAsTree. You can use my version by specifying [gem 'ancestry', :git => 'git://github.com/jims/ancestry.git'] in your gemfile.

I'll add a pull request if the author wants to incorporate these changes :>

from ancestry.

stefankroes avatar stefankroes commented on June 14, 2024

Fix by Jims was released in Ancestry 1.2.4. Thank you!

from ancestry.

hotsen avatar hotsen commented on June 14, 2024

I still have problems with this issue. We are using the official acts_as_tree plugin from https://github.com/rails/acts_as_tree

This version doesn't define an ActsAsTree module, so the patch doesn't work. Maybe it would be better to let the developer interface these aliases via an initializer or macro configuration option? As an example I'd like to choose not to alias the acts_as_tree method at all, because I don't care about ancestry downwards compatibility.



has_ancestry :alias_acts_as_tree => false

from ancestry.

JeanMertz avatar JeanMertz commented on June 14, 2024

hotsen, see the notice on that repository:

NOTICE: official repository moved to https://github.com/amerine/acts_as_tree

See if that fixes the problem.

from ancestry.

hotsen avatar hotsen commented on June 14, 2024

No sorry, it's the problem same there.

from ancestry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.