GithubHelp home page GithubHelp logo

ember-data-relationship-tracker's People

Contributors

alexspeller avatar balinterdi avatar ef4 avatar ember-tomster avatar heroiceric avatar nickrobinson avatar scottkidder avatar snewcomer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ember-data-relationship-tracker's Issues

Improvement: Add an example model setup to README

Overview

Add an example model setup to README

Why is this needed?

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.

Depends on server-provided "changed" version

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

Overview

As an edrt user I need a way to clear all relationships on save regardless of whether my relationshipTrackerVersion updates.

Why is this needed?

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.

Implementation Details

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.

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.