Skip to content

Instantly share code, notes, and snippets.

@mrinterweb
Created September 16, 2014 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrinterweb/f77469c590413193b326 to your computer and use it in GitHub Desktop.
Save mrinterweb/f77469c590413193b326 to your computer and use it in GitHub Desktop.
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
namespace: 'api/v1'
host: App.BaseUrl
setHeaders: (->
console.log "setting headers", @get('currentSession.token')
@set('headers',
token: @get('currentSession.token')
Accept: 'application/json'
)
).observes('currentSession.token').on('init')
findBelongsTo: (store, record, url)->
# doesn't get called
Em.debug "findBelongsTo called with: #{type}"
@_super(store, record, url)
findHasMany: (store, record, url)->
# doesn't get called
Em.debug "findHasMany called with: #{type}"
@_super(store, record, url)
findMany: (store, type, ids, record)->
# doesn't get called
Em.debug "findMany called with: #{type}"
@_super(store, type, ids, record)
find: (store, type, id, record)->
# is called, but not all the time, and not when I'd expect.
# When @store.find('my_model'), this function is not called
Em.debug "find called with: #{type}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment