Last active
August 29, 2015 14:05
-
-
Save gcollazo/5d449da53cd6313d6a00 to your computer and use it in GitHub Desktop.
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
import DS from 'ember-data'; | |
var Album = DS.Model.extend({ | |
name: DS.attr('string'), | |
artworkURL: DS.attr('string'), | |
artist: DS.belongsTo('artist'), | |
songs: DS.hasMany('song', {async: true}) | |
}); | |
// Album.reopenClass({ | |
// FIXTURES: [ | |
// {id: 1, name: 'Ultraviolence', artist: 1, | |
// artworkURL: 'http://i.imgur.com/KfVv5mr.jpg', | |
// songs: [1, 2, 3]}, | |
// {id: 2, name: 'Terror Amor', artist: 2, | |
// artworkURL: 'http://i.imgur.com/0Z7W6hh.jpg', | |
// songs: [4, 5]} | |
// ] | |
// }); | |
export default Album; |
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
import DS from 'ember-data'; | |
var Artist = DS.Model.extend({ | |
name: DS.attr('string'), | |
bio: DS.attr('string'), | |
albums: DS.hasMany('album') | |
}); | |
// Artist.reopenClass({ | |
// FIXTURES: [ | |
// {id: 1, name: 'Lana Del Rey'}, | |
// {id: 2, name: 'AJ Davila'} | |
// ] | |
// }); | |
export default Artist; |
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
import DS from 'ember-data'; | |
var Song = DS.Model.extend({ | |
name: DS.attr('string'), | |
album: DS.belongsTo('album'), | |
favorite: DS.attr('boolean'), | |
url: DS.attr('string'), | |
duration: DS.attr('number') | |
}); | |
// Song.reopenClass({ | |
// FIXTURES: [ | |
// {id: 1, name: 'Pretty When You Cry', album: 1, favorite: false}, | |
// {id: 2, name: 'Money Power Glory', album: 1, favorite: false}, | |
// {id: 3, name: 'West Coast', album: 2, favorite: true}, | |
// {id: 4, name: 'Animal', album: 1, favorite: false, url: 'http://upload.wikimedia.org/wikipedia/commons/0/0a/Wolfgang_Amadeus_Mozart_-_Don_Giovanni_-_Overt%C3%BCre.ogg'}, | |
// {id: 5, name: 'Dura Como Piedra', album: 2, favorite: true, url: 'http://upload.wikimedia.org/wikipedia/commons/5/5b/Ludwig_van_Beethoven_-_Symphonie_5_c-moll_-_1._Allegro_con_brio.ogg'} | |
// ] | |
// }); | |
export default Song; |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
needs: ['audio'], | |
songSelected: Ember.computed.alias('controllers.audio.songSelected'), | |
songInPlayer: Ember.computed.alias('controllers.audio.songInPlayer'), | |
audioIsPlaying: Ember.computed.alias('controllers.audio.isPlaying') | |
}); |
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
import DS from 'ember-data'; | |
var User = DS.Model.extend({ | |
email: DS.attr('string'), | |
songTotal: DS.attr('number'), | |
albumTotal: DS.attr('number'), | |
durationTotal: DS.attr('number') | |
}); | |
// User.reopenClass({ | |
// FIXTURES: [ | |
// {id: 1, songTotal: 11, albumTotal: 3, durationTotal: 1322}, | |
// {id: 2, songTotal: 21, albumTotal: 23, durationTotal: 21322}, | |
// ] | |
// }); | |
export default User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment