Last active
August 29, 2015 14:08
-
-
Save ultimatemonty/1ea1c56083e5ac763dea to your computer and use it in GitHub Desktop.
Models
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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