Skip to content

Commit

Permalink
Merge pull request #156 from juggy/proto-fix
Browse files Browse the repository at this point in the history
Change to 'proto' to use ember master
  • Loading branch information
wagenet committed Mar 13, 2012
2 parents eab1312 + bc9781e commit 487df2e
Show file tree
Hide file tree
Showing 3 changed files with 7,424 additions and 6,996 deletions.
2 changes: 1 addition & 1 deletion packages/ember-data/lib/system/model/attributes.js
Expand Up @@ -16,7 +16,7 @@ DS.Model.reopenClass({
processAttributeKeys: function() {
if (this.processedAttributeKeys) { return; }

var namingConvention = getPath(this, 'proto.namingConvention');
var namingConvention = this.proto().namingConvention;

this.eachComputedProperty(function(name, meta) {
if (meta.isAttribute && !meta.options.key) {
Expand Down
8 changes: 4 additions & 4 deletions packages/ember-data/lib/system/store.js
Expand Up @@ -477,7 +477,7 @@ DS.Store = Ember.Object.extend({


didCreateRecords: function(type, array, hashes) {
var primaryKey = getPath(type, 'proto.primaryKey'),
var primaryKey = type.proto().primaryKey,
typeMap = this.typeMapFor(type),
id, clientId;

Expand All @@ -497,7 +497,7 @@ DS.Store = Ember.Object.extend({
// The hash is optional, but if it is not provided, the client must have
// provided a primary key.

primaryKey = getPath(type, 'proto.primaryKey');
primaryKey = type.proto().primaryKey;

// TODO: Make ember_assert more flexible and convert this into an ember_assert
if (hash) {
Expand Down Expand Up @@ -670,7 +670,7 @@ DS.Store = Ember.Object.extend({
load: function(type, id, hash) {
if (hash === undefined) {
hash = id;
var primaryKey = getPath(type, 'proto.primaryKey');
var primaryKey = type.proto().primaryKey;
ember_assert("A data hash was loaded for a model of type " + type.toString() + " but no primary key '" + primaryKey + "' was provided.", primaryKey in hash);
id = hash[primaryKey];
}
Expand Down Expand Up @@ -703,7 +703,7 @@ DS.Store = Ember.Object.extend({
if (hashes === undefined) {
hashes = ids;
ids = [];
var primaryKey = getPath(type, 'proto.primaryKey');
var primaryKey = type.proto().primaryKey;

ids = Ember.ArrayUtils.map(hashes, function(hash) {
return hash[primaryKey];
Expand Down

0 comments on commit 487df2e

Please sign in to comment.