@cityads/ember-data-change-tracker 0.11.3 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/addon/utilities.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
**New**
|
|
6
6
|
- Experimental feature
|
|
7
7
|
- isDirty, hasDirtyRelations computed properties
|
|
8
|
-
- Set up in [configuration](https://github.com/
|
|
8
|
+
- Set up in [configuration](https://github.com/AlexMayants/ember-data-change-tracker#configuration) as { enableIsDirty: true }
|
|
9
9
|
- It is experimental and a has one crippling defect, it can not track object type
|
|
10
10
|
attributes. But if you don't have object types it works fine.
|
|
11
11
|
|
|
@@ -34,7 +34,7 @@ This addon aims to fill in the gaps in the change tracking / rollback that ember
|
|
|
34
34
|
|
|
35
35
|
## Installation
|
|
36
36
|
|
|
37
|
-
* `ember install ember-data-change-tracker`
|
|
37
|
+
* `ember install @cityads/ember-data-change-tracker`
|
|
38
38
|
|
|
39
39
|
## Why?
|
|
40
40
|
|
|
@@ -128,7 +128,7 @@ Usage:
|
|
|
128
128
|
### isDirty, hasDirtyRelations
|
|
129
129
|
- Computed properties to check if the model has changed
|
|
130
130
|
- Not enabled by default
|
|
131
|
-
- Need to set enableIsDirty ( true ) on model or global [configuration](https://github.com/
|
|
131
|
+
- Need to set enableIsDirty ( true ) on model or global [configuration](https://github.com/AlexMayants/ember-data-change-tracker#configuration)
|
|
132
132
|
- The only attributes that can NOT be tracked with isDirty are object/array
|
|
133
133
|
attributes
|
|
134
134
|
|
|
@@ -245,7 +245,7 @@ Example:
|
|
|
245
245
|
```javascript
|
|
246
246
|
// file: app/serializers/user.js
|
|
247
247
|
import DS from 'ember-data';
|
|
248
|
-
import keepOnlyChanged from 'ember-data-change-tracker/mixins/keep-only-changed';
|
|
248
|
+
import keepOnlyChanged from '@cityads/ember-data-change-tracker/mixins/keep-only-changed';
|
|
249
249
|
|
|
250
250
|
export default DS.RESTSerializer.extend(keepOnlyChanged);
|
|
251
251
|
```
|
|
@@ -295,7 +295,7 @@ For example:
|
|
|
295
295
|
|
|
296
296
|
import {moduleForModel, test} from 'ember-qunit';
|
|
297
297
|
import {make, manualSetup} from 'ember-data-factory-guy';
|
|
298
|
-
import {initializer as changeInitializer} from 'ember-data-change-tracker';
|
|
298
|
+
import {initializer as changeInitializer} from '@cityads/ember-data-change-tracker';
|
|
299
299
|
|
|
300
300
|
moduleForModel('project', 'Unit | Model | project', {
|
|
301
301
|
|
package/addon/utilities.js
CHANGED
|
@@ -21,7 +21,7 @@ export const relationShipTransform = {
|
|
|
21
21
|
hasMany: {
|
|
22
22
|
serialize(model, key, options) {
|
|
23
23
|
let relationship = model.hasMany(key).hasManyRelationship;
|
|
24
|
-
let value = relationship.state.hasReceivedData ? relationship.
|
|
24
|
+
let value = relationship.state.hasReceivedData ? relationship.localState: relationship.remoteState;
|
|
25
25
|
return value && value.map(item => modelTransform(item, options.polymorphic));
|
|
26
26
|
},
|
|
27
27
|
|