Use pushPayload instead of push

push doesn't normalize data, so it needs camelized properties etc.
This commit is contained in:
Piotr Sarnacki 2015-02-02 17:59:54 +01:00
parent 429d580b00
commit 56f4be5bb1
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ App = Ember.Application.extend(Ember.Evented,
}
delete(data.build.commit)
store.pushPayload(commit: [commit])
store.pushPayload(commits: [commit])
if event == 'job:log'
console.log 'store: received job:log event', data if Log.DEBUG

View File

@ -77,7 +77,7 @@ Auth = Ember.Object.extend
refreshUserData: (user) ->
Travis.ajax.get "/users/#{user.id}", (data) =>
@store.push('user', data.user)
@store.pushPayload(users: [data.user])
# if user is still signed in, update saved data
if @get('signedIn')
data.user.token = user.token
@ -103,7 +103,7 @@ Auth = Ember.Object.extend
storage.setItem('travis.user', JSON.stringify(data.user))
loadUser: (user) ->
@store.push('user', user)
@store.pushPayload(users: [user])
user = @store.find('user', user.id)
user.get('permissions')
user