Ember style improvements
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
# http://emberjs.com/guides/models/defining-a-store/
|
|
||||||
#DS.RESTAdapter.reopen
|
|
||||||
# namespace: 'supplier'
|
|
||||||
|
|
||||||
Qsupplier.App.ApplicationSerializer = DS.ActiveModelSerializer
|
Qsupplier.App.ApplicationSerializer = DS.ActiveModelSerializer
|
||||||
|
|
||||||
Qsupplier.App.ApplicationStore = DS.Store.extend
|
Qsupplier.App.ApplicationStore = DS.Store.extend
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
# http://emberjs.com/guides/models/defining-a-store/
|
App.ApplicationSerializer = DS.ActiveModelSerializer.extend
|
||||||
DS.RESTAdapter.reopen
|
|
||||||
namespace: 'user'
|
|
||||||
|
|
||||||
DS.ActiveModelSerializer.reopen
|
|
||||||
serializeBelongsTo: (record, json, relationship) ->
|
serializeBelongsTo: (record, json, relationship) ->
|
||||||
console.log "Serialize belongsTo #{record.toString()}"
|
console.log "Serialize belongsTo #{record.toString()}"
|
||||||
key = relationship.key
|
key = relationship.key
|
||||||
@@ -26,13 +22,10 @@ DS.ActiveModelSerializer.reopen
|
|||||||
else
|
else
|
||||||
@_super record, json, relationship
|
@_super record, json, relationship
|
||||||
|
|
||||||
App.ApplicationSerializer = DS.ActiveModelSerializer
|
|
||||||
|
|
||||||
App.CustomAdapter = DS.RESTAdapter.extend
|
|
||||||
|
|
||||||
# user underscored paths
|
|
||||||
pathForType: (type)->
|
|
||||||
decamelized = Ember.String.decamelize(type)
|
|
||||||
Ember.String.pluralize(decamelized)
|
|
||||||
App.Store = DS.Store.extend
|
App.Store = DS.Store.extend
|
||||||
adapter: App.CustomAdapter
|
adapter: DS.RESTAdapter.extend
|
||||||
|
namespace: 'user'
|
||||||
|
# user underscored paths
|
||||||
|
pathForType: (type)->
|
||||||
|
decamelized = Ember.String.decamelize(type)
|
||||||
|
Ember.String.pluralize(decamelized)
|
||||||
|
|||||||
Reference in New Issue
Block a user