Skip to content

Commit

Permalink
lets modelNamespace return key.typeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
fsmanuel committed Mar 7, 2014
1 parent be594a2 commit 5f4888e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion localstorage_adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
},

modelNamespace: function(type) {
return type.url || type.toString();
return type.url || type.typeKey;
},


Expand Down
8 changes: 4 additions & 4 deletions test/helpers.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
Ember.ENV.TESTING = true;

var FIXTURES = {
'App.List': {
'list': {
records: {
'l1': { id: 'l1', name: 'one', b: true, items: ['i1', 'i2'] },
'l2': { id: 'l2', name: 'two', b: false, items: [] },
'l3': { id: 'l3', name: 'three', b: false, items: [] }
}
},

'App.Item': {
'item': {
records: {
'i1': { id: 'i1', name: 'one', list: 'l1' },
'i2': { id: 'i2', name: 'two', list: 'l1' }
}
},

'App.Order': {
'order': {
records: {
'o1': { id: 'o1', name: 'one', b: true, hours: ['h1', 'h2'] },
'o2': { id: 'o2', name: 'two', b: false, hours: [] },
Expand All @@ -25,7 +25,7 @@ var FIXTURES = {
}
},

'App.Hour': {
'hour': {
records: {
'h1': { id: 'h1', name: 'one', amount: 4, order: 'o1' },
'h2': { id: 'h2', name: 'two', amount: 3, order: 'o1' },
Expand Down
8 changes: 0 additions & 8 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,23 @@ module('DS.LSAdapter', {
items: DS.hasMany('item')
});

App.List.toString = stringify('App.List');

App.Item = DS.Model.extend({
name: DS.attr('string'),
list: DS.belongsTo('list')
});

App.Item.toString = stringify('App.Item');

App.Order = DS.Model.extend({
name: DS.attr('string'),
b: DS.attr('boolean'),
hours: DS.hasMany('hour')
});

App.Order.toString = stringify('App.Order');

App.Hour = DS.Model.extend({
name: DS.attr('string'),
amount: DS.attr('number'),
order: DS.belongsTo('order')
});

App.Hour.toString = stringify('App.Hour');

env = setupStore({
list: App.List,
item: App.Item,
Expand Down

0 comments on commit 5f4888e

Please sign in to comment.