#= require models/data_collector

adapter = if window.location.search.lastIndexOf('fixture') != -1
            DS.FixtureAdapter.extend
              latency: 250
          else
            DS.RESTAdapter.configure 'plurals',
              event_search: 'event_searches'

            DS.RESTAdapter.extend
              namespace: 'api/v1'

Pancakes.Adapter = adapter

Pancakes.Adapter.map 'Pancakes.DataCollector',
  primaryKey: 'username'

# vim:ts=2:sw=2:et:tw=78

#= require models/data_collector
#= require models/event_search

adapter = if window.location.search.lastIndexOf('fixture') != -1
            DS.FixtureAdapter.extend
              latency: 250
          else
            DS.RESTAdapter.configure 'plurals',
              event_search: 'event_searches'

            DS.RESTAdapter.extend
              namespace: 'api/v1'

Pancakes.Adapter = adapter

Pancakes.Adapter.map 'Pancakes.DataCollector',
  primaryKey: 'username'

Pancakes.Adapter.map 'Pancakes.EventSearch',
  eventTypes:
    embedded: 'always'
  dataCollectors:
    embedded: 'always'
  studyLocations:
    embedded: 'always'

# vim:ts=2:sw=2:et:tw=78

Embed associated data in EventSearch.
Embed associated data in EventSearch.

This has a couple benefits:

1. The search becomes self-contained.  Combined with persistence on the
   server, this means that the search parameters remain the same
   forever.  (Or at least as long as Pancakes' database stays intact.)
2. We can send an entire event search in one POST request.  There's
   other ways to do this in Ember Data, but this is the easiest way to
   do it with the built-in REST adapter.

Of course, this also means that we introduce denormalization, but in
this case I think it's acceptable.
