Skip to content
Browse files

Rename findAllLoaded() to all()

  • Loading branch information...
1 parent a773a6c commit 5267002c1595ffaba727cf074346d4da54c62685 @patr1ck patr1ck committed May 22, 2012
Showing with 7 additions and 7 deletions.
  1. +4 −4 packages/ember-data/lib/system/store.js
  2. +3 −3 packages/ember-data/tests/unit/store_test.js
View
8 packages/ember-data/lib/system/store.js
@@ -443,16 +443,16 @@ DS.Store = Ember.Object.extend({
return array;
},
- findAllLoaded: function(type) {
+ all: function(type) {
var typeMap = this.typeMapFor(type),
- findAllLoadedCache = typeMap.findAllLoadedCache;
+ allLoadedCache = typeMap.allLoadedCache;
- if (findAllLoadedCache) { return findAllLoadedCache; }
+ if (allLoadedCache) { return allLoadedCache; }
var array = DS.RecordArray.create({ type: type, content: Ember.A([]), store: this });
this.registerRecordArray(array, type);
- typeMap.findAllLoadedCache = array;
+ typeMap.allLoadedCache = array;
return array;
},
View
6 packages/ember-data/tests/unit/store_test.js
@@ -328,7 +328,7 @@ test("findAll(type) returns a record array of all records of a specific type", f
strictEqual(results, store.findAll(Person), "subsequent calls to findAll return the same recordArray)");
});
-test("findAllLoaded(type) returns a record array of all loaded records of a specific type", function() {
+test("all(type) returns a record array of all loaded records of a specific type", function() {
var adapter = DS.Adapter.create({
findAll: function(){
equal(null, 1, "findAll() was called when it should not have been.");
@@ -343,15 +343,15 @@ test("findAllLoaded(type) returns a record array of all loaded records of a spec
store.load(Person, 1, { id: 1, name: "Tom Dale" });
- var results = store.findAllLoaded(Person);
+ var results = store.all(Person);
equal(get(results, 'length'), 1, "record array should have the original object");
equal(get(results.objectAt(0), 'name'), "Tom Dale", "record has the correct information");
store.load(Person, 2, { id: 2, name: "Yehuda Katz" });
equal(get(results, 'length'), 2, "record array should have the new object");
equal(get(results.objectAt(1), 'name'), "Yehuda Katz", "record has the correct information");
- strictEqual(results, store.findAllLoaded(Person), "subsequent calls to findAllLoaded return the same recordArray)");
+ strictEqual(results, store.all(Person), "subsequent calls to all() return the same recordArray)");
});

0 comments on commit 5267002

Please sign in to comment.
Something went wrong with that request. Please try again.