Skip to content

Instantly share code, notes, and snippets.

@ultimatemonty
Last active August 29, 2015 14:08
Show Gist options
  • Save ultimatemonty/1ea1c56083e5ac763dea to your computer and use it in GitHub Desktop.
Save ultimatemonty/1ea1c56083e5ac763dea to your computer and use it in GitHub Desktop.
Models
var string = DS.attr('string'),
bool = DS.attr('boolean'),
number = DS.attr('number'),
date = DS.attr('date'),
isoDate = DS.attr('isodate');
App.Location = DS.Model.extend({
name: string,
iata: string,
icao: string,
isActive: bool,
sites: DS.hasMany('site', { async: true })
});
var inflector = Ember.Inflector.inflector;
inflector.irregular('site-category', 'site-categories');
App.SiteCategory = DS.Model.extend({
name: string,
isActive: bool
});
App.Site = DS.Model.extend({
name: string,
isActive: bool,
siteCategory: DS.belongsTo('site-category', { async: true }),
location: DS.belongsTo('location', { async: true })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment