How to use active-model-adapter - 10 common examples

To help you get started, we’ve selected a few active-model-adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github travis-ci / travis-web / app / adapters / application.js View on Github external
import config from 'travis/config/environment';
import Ember from 'ember';
import ActiveModelAdapter from 'active-model-adapter';

const { service } = Ember.inject;

export default ActiveModelAdapter.extend({
  auth: service(),
  features: service(),
  host: config.apiEndpoint,
  coalesceFindRequests: true,

  // Before Ember Data 2.0 the default behaviour of running `findAll` was to get
  // new records only when there're no records in the store. This will change
  // to a different strategy in 2.0: when you run `findAll` it will not get any
  // new data initially, but it will try loading new data in the background.
  //
  // I'm disabling the new behaviour for now.
  shouldBackgroundReloadRecord() {
    return false;
  },

  ajaxOptions() {
github danielspaniel / ember-data-factory-guy / addon / builder / fixture-builder-factory.js View on Github external
import require from 'require';
import DS from 'ember-data';
import JSONAPIFixtureBuilder from './jsonapi-fixture-builder';
import RESTFixtureBuilder from './rest-fixture-builder';
import JSONFixtureBuilder from './json-fixture-builder';
import DRFFixtureBuilder from './drf-fixture-builder';
import ActiveModelFixtureBuilder from './active-model-fixture-builder';

let ActiveModelSerializer, DjangoSerializer;
try {
  let activeModel = require('active-model-adapter');
  ActiveModelSerializer = activeModel.ActiveModelSerializer;
} catch (e) {
  // do nothing
}

try {
  let drf = require('ember-django-adapter/serializers/drf');
  DjangoSerializer = drf && drf.default;
} catch (e) {
  // do nothing
}

export default class {

  constructor(store) {
    this.store = store;
  }
github miragejs / ember-cli-mirage / tests / dummy / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  namespace: 'api'
});
github cowboyd / mirage-server / tests / dummy / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  namespace: 'api'
});
github ember-admin / ember-cli-admin / tests / dummy / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  namespace: 'api'
});
github Vestorly / ember-cli-infinite-scroll / tests / dummy / app / adapters / application.js View on Github external
import { ActiveModelAdapter } from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  host: 'http://staging.vestorly.com',
  namespace: 'api/v3/reader/publishers/infinite-scroll'
});
github PrecisionNutrition / ember-data-polymorphic-full-stack-example / ember / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  host: 'http://localhost:3009'
});
github abuiles / borrowers / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  namespace: 'api/v4',
  coalesceFindRequests: true
});
github coala / git-task-list / app / adapters / application.js View on Github external
import ActiveModelAdapter from 'active-model-adapter';

export default ActiveModelAdapter.extend({
  host: 'https://api.github.com',
  queryUrl: 'https://api.github.com/search',
  buildURL(modelName, id, snapshot, requestType) {
    if(requestType === 'query') {
      this.host = this.queryUrl
    }
    return this._super(...arguments);
  }
});

active-model-adapter

Adapters and Serializers for Rails's ActiveModel::Serializers

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis