Giter Site home page Giter Site logo

dm-is-tree's People

Contributors

be9 avatar benburkert avatar bernerdschaefer avatar burningtyger avatar cypher avatar dkubb avatar kematzy avatar michaelklishin avatar myabc avatar namelessjon avatar paul avatar pdlug avatar sam avatar snusnu avatar solnic avatar somebee avatar xaviershay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dm-is-tree's Issues

Constraints?

It would be awesome if dm-is-tree was compatible with dm-constraints!
I was able to add a constraint to protect nodes with children by repeating the children relationship like this:

is :tree
has n, :children, :model => self, :child_key => :parent_id, :constraint => :protect

However, it would be much more convenient if one could simply say:

is :tree, :constraint => :protect

Eager Load entire tree?

I've got a page where I need to display all elements in a table, and it just takes forever to load, partly because it issues a separate query to retrieve each node's children. I imagine it would go much faster to load all the rows at once, and then associate them based on their parent_ids. This, of course, isn't a good solution if you need to load only 10% of a large table, and there's no way to determine which rows need to be loaded without checking for parent_ids one query at a time.

To solve that it might be a good idea to setup something like "eager-loading sets" where you could tag each instance with a set name, so you could eager load a named set... or something.

But for starters, just eager loading the whole table would be awesome.

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.