ember-resourceful-rails 0.0.3 → 0.0.3.1
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.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDZlYjUzYzM2ODUyZDRkODA0ZDBhOGM2NzIyODZkMTU3ZjQ5OWUyOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWY3NDgzM2E4MzQ0Y2E2OTYzZmU1ODA2ODI0NDY0NWMxZTdiZTIwOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTMyOWJkYWUyZDNhYjQ3ZjJjNDhhNDZmOGU3ZjMxYTFiMDNlOWYyNDhhYjA2
|
10
|
+
NDAzMWZhOWZmOWQxMzBlNjEzMTQ2MThmMzFiMWQ2ODJiYzhkMzkzNmJlMjZm
|
11
|
+
ODhkMWUyODYzODYzZGJlZmZiMDM1NWRiZWEwMzhjMzM5NTk0OTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmI2NmI4MGI0MmE4YTg0NmI3MWY0MjBlZmVkMDAwNjMwOTdjNTVhYTQ5OTIw
|
14
|
+
MTM5NTYwZmVhMTc2OWNmMzViZWU4ODg4MTMwMWVkMDMxNjQzOGUxMzU3MjQ2
|
15
|
+
YjhlY2JmOGM0OTIwM2EwZWJhZTVlYTRhYjhkMGRmZDgyYjM4ODc=
|
@@ -233,19 +233,19 @@ Resourceful.ResourceCollection = Ember.ArrayProxy.extend({
|
|
233
233
|
|
234
234
|
init: function() {
|
235
235
|
var _this = this;
|
236
|
-
|
236
|
+
|
237
237
|
this._super();
|
238
|
-
|
238
|
+
|
239
239
|
this._resourceIndex = {};
|
240
|
-
|
240
|
+
|
241
241
|
if (!this.get('content')) {
|
242
242
|
this.set('content', []);
|
243
243
|
}
|
244
|
-
|
244
|
+
|
245
245
|
this.addArrayObserver(Ember.Object.create({
|
246
246
|
arrayWillChange: function(observedObj, start, removeCount, addCount) {
|
247
247
|
var removed;
|
248
|
-
|
248
|
+
|
249
249
|
if (removeCount > 0) {
|
250
250
|
observedObj.slice(start, start + removeCount).forEach(function(resource) {
|
251
251
|
if (_this._resourceIndex[resource.id]) {
|
@@ -256,7 +256,7 @@ Resourceful.ResourceCollection = Ember.ArrayProxy.extend({
|
|
256
256
|
},
|
257
257
|
arrayDidChange: function(observedObj, start, removeCount, addCount) {
|
258
258
|
var added, filtered;
|
259
|
-
|
259
|
+
|
260
260
|
if (addCount > 0) {
|
261
261
|
observedObj.slice(start, start + addCount).forEach(function(resource) {
|
262
262
|
_this._resourceIndex[resource.id] = resource;
|
@@ -332,7 +332,7 @@ Resourceful.ResourceCollection = Ember.ArrayProxy.extend({
|
|
332
332
|
load: function(json) {
|
333
333
|
var resource;
|
334
334
|
|
335
|
-
resource = this._resourceIndex[id];
|
335
|
+
resource = this._resourceIndex[json.id];
|
336
336
|
|
337
337
|
if (!resource) {
|
338
338
|
resource = this.resourceClass.create();
|
@@ -343,7 +343,7 @@ Resourceful.ResourceCollection = Ember.ArrayProxy.extend({
|
|
343
343
|
|
344
344
|
resource._updatePersistedProperties();
|
345
345
|
},
|
346
|
-
|
346
|
+
|
347
347
|
_resourceUrl: function() {
|
348
348
|
return this.resourceAdapter.namespace + this.resourceClass.resourceUrl;
|
349
349
|
}
|