ef4 / ember-data-relationship-tracker Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add an example model setup to README
Currently there is some misleading information in the README. First, the README states that you need a version
field on your model, when you really need a relationshipTrackerVersion
variable.
Second, I think the documentation could be improved by providing users with an example model setup.
This addon was an extraction from an app, and I've realized that it is depending on some behavior of that app's particular server: it expects the server to set a changed
timestamp on each record.
We can it adjust it to not depend on that, but as it is it won't work right with servers that don't do this.
As an edrt user I need a way to clear all relationships on save regardless of whether my relationshipTrackerVersion updates.
Let's say we have a Post model and a Comment model. The Post model has a hasMany
relationship on comments. In my case when I save a post with related comments, and a comment changes, the version of the changed comments increments, while the Post version stays the same. The problem is that this causes the Post model to remain in a state where hasDirtyFields is true.
I think we need a way to allow the user to indicate that the relationshipTracker should be reset after a save. For example, I am doing this in a current model that is being affected by this issue:
clearRelationshipTracking() {
this._relationshipTracker = Object.create(null);
this.notifyPropertyChange('relationshipTrackerVersion');
},
I am then calling clearRelationshipTracking any time I perform a save on the Post model.
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.