How to use the ember-cli-mirage.belongsTo function in ember-cli-mirage

To help you get started, we’ve selected a few ember-cli-mirage 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 miragejs / ember-cli-mirage / tests / integration / orm / mixed / 3-one-to-many-polymorphic / _helper.js View on Github external
constructor() {
    this.db = new Db();

    this.schema = new Schema(this.db, {
      user: Model.extend({
        things: hasMany({ polymorphic: true })
      }),
      post: Model.extend({
        user: belongsTo({ inverse: 'things' })
      })
    });
  }
github code-corps / code-corps-ember / mirage / models / task-user-mention.js View on Github external
import { Model, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  task: belongsTo(),
  user: belongsTo()
});
github hashicorp / nomad / ui / mirage / models / job.js View on Github external
import { Model, hasMany, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  task_groups: hasMany('task-group'),
  job_summary: belongsTo('job-summary'),
});
github code-corps / code-corps-ember / mirage / models / preview-user-mention.js View on Github external
import { Model, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  preview: belongsTo(),
  user: belongsTo()
});
github travis-ci / travis-web / mirage / models / repository.js View on Github external
import { Model, hasMany, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  branches: hasMany(),
  builds: hasMany('build'),
  envVars: hasMany(),
  settings: hasMany(),
  caches: hasMany(),
  defaultBranch: belongsTo('branch'),
  currentBuild: belongsTo('build'),
});
github travis-ci / travis-web / mirage / models / job.js View on Github external
import { Model, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  commit: belongsTo(),
  build: belongsTo(),
  repository: belongsTo('repository'),
  stage: belongsTo()
});
github code-corps / code-corps-ember / mirage / models / user.js View on Github external
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  githubAppInstallations: hasMany('github-app-installation'),
  organizations: hasMany('organization'),
  projectUsers: hasMany('project-user'),
  sluggedRoute: belongsTo('slugged-route'),
  stripeConnectSubscriptions: hasMany('stripe-connect-subscription'),
  stripePlatformCard: belongsTo('stripe-platform-card'),
  stripePlatformCustomer: belongsTo('stripe-platform-customer'),
  userCategories: hasMany('user-category'),
  userRoles: hasMany('user-role'),
  userSkills: hasMany('user-skill')
});
github travis-ci / travis-web / mirage / models / commit.js View on Github external
import { Model, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  build: belongsTo('build', { inverseOf: 'commit' }),
  committer: belongsTo('git-user'),
  author: belongsTo('git-user'),
  job: belongsTo('job')
});
github travis-ci / travis-web / mirage / models / stage.js View on Github external
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  jobs: hasMany('job'),
  build: belongsTo('build'),
});