How to use the ember-cli-mirage.hasMany 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 / serializers / schema-helper.js View on Github external
setup() {
    return new Schema(new Db(), {
      wordSmith: Model.extend({
        blogPosts: hasMany()
      }),
      blogPost: Model.extend({
        wordSmith: belongsTo(),
        fineComments: hasMany()
      }),
      fineComment: Model.extend({
        blogPost: belongsTo()
      }),
      greatPhoto: Model,

      foo: Model.extend({
        bar: belongsTo()
      }),
      bar: Model.extend({
        baz: belongsTo()
      }),
      baz: Model.extend({
        quuxes: hasMany()
      }),
      quux: Model.extend({
github miragejs / ember-cli-mirage / tests / integration / serializers / schema-helper.js View on Github external
wordSmith: belongsTo(),
        fineComments: hasMany()
      }),
      fineComment: Model.extend({
        blogPost: belongsTo()
      }),
      greatPhoto: Model,

      foo: Model.extend({
        bar: belongsTo()
      }),
      bar: Model.extend({
        baz: belongsTo()
      }),
      baz: Model.extend({
        quuxes: hasMany()
      }),
      quux: Model.extend({
        zomgs: hasMany()
      }),
      zomg: Model.extend({
        lol: belongsTo()
      }),
      lol: Model
    });
  }
github emberobserver / client / mirage / models / category.js View on Github external
import { Model, hasMany, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  parent: belongsTo('category', { inverse: 'subcategories' }),
  subcategories: hasMany('category', { inverse: 'parent' }),
  addons: hasMany('addon')
});
github emberobserver / client / mirage / models / addon.js View on Github external
import { Model, hasMany, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  readme: belongsTo(),
  latestAddonVersion: belongsTo('version', { inverse: null }),
  latestReview: belongsTo('review', { inverse: null }),
  versions: hasMany('version', { inverse: 'addon' }),
  keywords: hasMany(),
  categories: hasMany(),
  maintainers: hasMany(),
  githubUsers: hasMany(),
});
github hashicorp / nomad / ui / mirage / models / csi-volume.js View on Github external
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  plugin: belongsTo('csi-plugin'),
  writeAllocs: hasMany('allocation'),
  readAllocs: hasMany('allocation'),
  allocations: hasMany('allocation'),
});
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 code-corps / code-corps-ember / mirage / models / project.js View on Github external
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  donationGoals: hasMany('donation-goal'),
  githubRepos: hasMany('github-repo'),
  organization: belongsTo(),
  projectCategories: hasMany('project-category'),
  projectSkills: hasMany('project-skill'),
  projectUsers: hasMany('project-user'),
  stripeConnectPlan: belongsTo('stripe-connect-plan'),
  taskLists: hasMany('task-list'),
  tasks: hasMany()
});
github elwayman02 / ember-data-github / mirage-support / models / github-repository.js View on Github external
import { Model, belongsTo, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  owner: belongsTo('githubUser', { inverse: null }),
  defaultBranch: belongsTo('github-branch', { inverse: null }),
  pulls: hasMany('github-pull'),
  branches: hasMany('github-branch'),
  releases: hasMany('github-release')
});
github travis-ci / travis-web / mirage / models / account.js View on Github external
import { Model, hasMany } from 'ember-cli-mirage';

export default Model.extend({
  repositories: hasMany(),
});
github emberobserver / client / mirage / models / addon.js View on Github external
import { Model, hasMany, belongsTo } from 'ember-cli-mirage';

export default Model.extend({
  readme: belongsTo(),
  latestAddonVersion: belongsTo('version', { inverse: null }),
  latestReview: belongsTo('review', { inverse: null }),
  versions: hasMany('version', { inverse: 'addon' }),
  keywords: hasMany(),
  categories: hasMany(),
  maintainers: hasMany(),
  githubUsers: hasMany(),
});