datamapper / dm-is-tree Goto Github PK
View Code? Open in Web Editor NEWDataMapper plugin allowing the creation of tree structures from data models
Home Page: http://datamapper.org/
License: MIT License
DataMapper plugin allowing the creation of tree structures from data models
Home Page: http://datamapper.org/
License: MIT License
Would be useful to have something like
is :tree, :dependent => :destroy
for cases where you'd like to "prune" your tree
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.