How to use the ember-data/attr function in ember-data

To help you get started, we’ve selected a few ember-data 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 elwayman02 / ember-data-github / addon / models / github-repository.js View on Github external
cloneUrl: attr('string'),
  gitUrl: attr('string'),
  sshUrl: attr('string'),
  svnUrl: attr('string'),

  // Urls
  archiveUrl: attr('string'),
  assigneesUrl: attr('string'),
  blobsUrl: attr('string'),
  branchesUrl: attr('string'),
  collaboratorsUrl: attr('string'),
  commentsUrl: attr('string'),
  commitsUrl: attr('string'),
  compareUrl: attr('string'),
  contentsUrl: attr('string'),
  contributorsUrl: attr('string'),
  deploymentsUrl: attr('string'),
  downloadsUrl: attr('string'),
  eventsUrl: attr('string'),
  forksUrl: attr('string'),
  gitCommitsUrl: attr('string'),
  gitRefsUrl: attr('string'),
  gitTagsUrl: attr('string'),
  hooksUrl: attr('string'),
  htmlUrl: attr('string'),
  issueCommentUrl: attr('string'),
  issueEventsUrl: attr('string'),
  issuesUrl: attr('string'),
  keysUrl: attr('string'),
  labelsUrl: attr('string'),
  mergesUrl: attr('string'),
github noironetworks / aci-containers / vendor / github.com / hashicorp / consul / ui-v2 / app / models / service.js View on Github external
Meta: attr(),
  Address: attr('string'),
  TaggedAddresses: attr(),
  Port: attr('number'),
  EnableTagOverride: attr('boolean'),
  CreateIndex: attr('number'),
  ModifyIndex: attr('number'),
  // TODO: These should be typed
  ChecksPassing: attr(),
  ChecksCritical: attr(),
  ChecksWarning: attr(),
  Nodes: attr(),
  Datacenter: attr('string'),
  Node: attr(),
  Service: attr(),
  Checks: attr(),
  SyncTime: attr('number'),
  meta: attr(),
  passing: computed('ChecksPassing', 'Checks', function() {
    let num = 0;
    // TODO: use typeof
    if (get(this, 'ChecksPassing') !== undefined) {
      num = get(this, 'ChecksPassing');
    } else {
      num = get(get(this, 'Checks').filterBy('Status', 'passing'), 'length');
    }
    return {
      length: num,
    };
  }),
  hasStatus: function(status) {
    let num = 0;
github adfinis-sygroup / ember-validated-form / tests / dummy / app / models / user.js View on Github external
import Model from "ember-data/model";
import attr from "ember-data/attr";

export default Model.extend({
  firstName: attr("string"),
  lastName: attr("string"),
  aboutMe: attr("string"),
  country: attr("string"),
  gender: attr("string"),
  terms: attr("string"),
  color: attr("string")
});
github fossasia / open-event-frontend / app / models / event-copyright.js View on Github external
import attr from 'ember-data/attr';
import ModelBase from 'open-event-frontend/models/base';
import { belongsTo } from 'ember-data/relationships';

export default ModelBase.extend({
  holder     : attr('string'),
  holderUrl  : attr('string'),
  licence    : attr('string'),
  licenceUrl : attr('string'),
  year       : attr('number'),
  logoUrl    : attr('string'),

  event: belongsTo('event')
});
github exercism / gui / app / track / model.js View on Github external
import Ember from 'ember';
import Model from 'ember-data/model';
import attr from 'ember-data/attr';

export default Model.extend({
  language: attr('string'),
  active: attr('boolean'),
  repository: attr('string'),
  slug: attr('string'),
  todo: attr(),
  problems: attr(),

  languageUrl: Ember.computed('slug', function() {
    return `http://exercism.io/languages/${this.get('slug')}`;
  }),
  imageSrc: Ember.computed('slug', function() {
    return `http://exercism.io/tracks/${this.get('slug')}/icon`;
  })
});
github elwayman02 / ember-data-github / addon / models / github-release.js View on Github external
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo } from 'ember-data/relationships';
import { deprecate } from '@ember/application/deprecations';
import { computed } from '@ember/object';

export default Model.extend({
  name: attr('string'),
  url: attr('string'),
  htmlUrl: attr('string'),
  assetsUrl: attr('string'),
  uploadUrl: attr('string'),
  tarballUrl: attr('string'),
  zipballUrl: attr('string'),
  tagName: attr('string'),
  targetCommitish: attr('string'),
  body: attr('string'),
  draft: attr('boolean'),
  prerelease: attr('boolean'),
  createdAt: attr('date'),
  publishedAt: attr('date'),

  author: belongsTo('github-user', { inverse: null }),
  user: computed('author', function() {
    deprecate('The user property on the github-release model has been deprecated.  Please use the author property.', false, { id: 'ember-data-github.deprecated-model-props', until: '1.0.0' });
    return this.get('author');
  }),
  repository: belongsTo('github-repository')
});
github code-corps / code-corps-ember / app / models / stripe-connect-account.js View on Github external
legalEntityVerificationDetailsCode: attr(),
  legalEntityVerificationDocument: attr(),
  legalEntityVerificationStatus: attr(),
  idFromStripe: attr(),
  payoutsEnabled: attr(),
  personalIdNumberStatus: attr(),
  recipientStatus: attr(),
  supportEmail: attr(),
  supportPhone: attr(),
  supportUrl: attr(),
  tosAcceptanceDate: attr(),
  type: attr(),
  updatedAt: attr(),
  verificationDisabledReason: attr(),
  verificationDocumentStatus: attr(),
  verificationDueBy: attr(),
  verificationFieldsNeeded: attr(),

  organization: belongsTo('organization', { async: true })
});
github hummingbird-me / hummingbird-client / app / models / user.js View on Github external
facebookId: attr('string'),
  favoritesCount: attr('number'),
  feedCompleted: attr('boolean'),
  followersCount: attr('number'),
  followingCount: attr('number'),
  gender: attr('string'),
  hasPassword: attr('boolean'),
  language: attr('string'),
  likesGivenCount: attr('number'),
  location: attr('string'),
  mediaReactionsCount: attr('number'),
  name: attr('string'),
  password: attr('string'),
  pastNames: attr('array'),
  postsCount: attr('number'),
  proTier: attr('string'),
  proExpiresAt: attr('utc'),
  profileCompleted: attr('boolean'),
  ratingsCount: attr('number'),
  ratingSystem: attr('string', { defaultValue: 'simple' }),
  reviewsCount: attr('number'),
  roles: attr('array'),
  sfwFilter: attr('boolean'),
  slug: attr('string'),
  shareToGlobal: attr('boolean'),
  status: attr('string', { defaultValue: 'registered' }),
  subscribedToNewsletter: attr('boolean'),
  timeZone: attr('string'),
  title: attr('string'),
  titleLanguagePreference: attr('string', { defaultValue: 'canonical' }),
  theme: attr('string', { defaultValue: 'light' }),
  waifuOrHusbando: attr('string'),
github code-corps / code-corps-ember / app / models / donation-goal.js View on Github external
import Model from 'ember-data/model';
import attr from 'ember-data/attr';
import { belongsTo } from 'ember-data/relationships';

export default Model.extend({
  achieved: attr(),
  /**
   * Donation amount, in cents
   *
   * @property amount
   * @type { Number }
   */
  amount: attr('dollar-cents'),
  current: attr(),
  description: attr(),

  project: belongsTo('project', { async: true })
});
github fossasia / open-event-frontend / app / models / event.js View on Github external
searchableLocationName : attr('string'),

  longitude : attr('number', { defaultValue: 0.0 }),
  latitude  : attr('number', { defaultValue: 0.0 }),

  logoUrl           : attr('string'),
  thumbnailImageUrl : attr('string', { readOnly: true }),
  largeImageUrl     : attr('string', { readOnly: true }),
  originalImageUrl  : attr('string'),
  iconImageUrl      : attr('string', { readOnly: true }),

  isMapShown                : attr('boolean', { defaultValue: true }),
  isSponsorsEnabled         : attr('boolean', { defaultValue: false }),
  isTicketFormEnabled       : attr('boolean', { defaultValue: false }),
  isTicketingEnabled        : attr('boolean', { defaultValue: true }),
  isSessionsSpeakersEnabled : attr('boolean', { defaultValue: false }),
  isFeatured                : attr('boolean', { defaultValue: false }),

  isTaxEnabled    : attr('boolean', { defaultValue: false }),
  canPayByPaypal  : attr('boolean', { defaultValue: false }),
  canPayByPaytm   : attr('boolean', { defaultValue: false }),
  canPayByStripe  : attr('boolean', { defaultValue: false }),
  isStripeLinked  : attr('boolean'),
  canPayByCheque  : attr('boolean', { defaultValue: false }),
  canPayByBank    : attr('boolean', { defaultValue: false }),
  canPayByOmise   : attr('boolean', { defaultValue: false }),
  canPayByAlipay  : attr('boolean', { defaultValue: false }),
  canPayOnsite    : attr('boolean', { defaultValue: false }),
  paymentCountry  : attr('string'),
  paymentCurrency : attr('string', { defaultValue: 'USD' }),
  paypalEmail     : attr('string'),
  chequeDetails   : attr('string'),