Last active
June 30, 2017 10:36
-
-
Save samselikoff/813bf92e079f34935a5ede6e839a657d 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
export default function(server) { | |
window.server = server; | |
server.create('series', 'withClips', { | |
title: 'Acceptance Testing', | |
slug: 'acceptance-testing', | |
posterUrl: 'https://d19c50bha6zcb3.cloudfront.net/images/84ed58d2-8728-4c05-b4e1-497417404a03/acceptance-testing.png' | |
}); | |
let firstATclip = server.schema.series | |
.where({ slug: 'acceptance-testing' }) | |
.models[0] | |
.clips | |
.models[0]; | |
server.create('reaction-count', { | |
reactableType: 'Clip', | |
reactable: firstATclip, | |
reaction: 'heart', | |
total: 9 | |
}); | |
server.create('series', 'withClips', { | |
title: 'Ember Concurrency', | |
slug: 'ember-concurrency', | |
description: 'Conquer time by writing better asynchronous code.', | |
posterUrl: '/assets/images/posters/ember-concurrency.png' | |
}); | |
server.create('series', 'withClips', { | |
title: 'Contextual Components', | |
slug: 'contextual-components', | |
description: 'Foo bar the baz', | |
posterUrl: 'https://embermap-assets.s3.amazonaws.com/public/images/2318553f-9a35-455e-8870-964dbaafd216/contextual-components.png' | |
}); | |
let d3 = server.create('series', 'withClips', { | |
title: 'Using Ember with D3', | |
slug: 'd3', | |
description: 'Foo bar the baz', | |
posterUrl: 'https://d19c50bha6zcb3.cloudfront.net/images/d4442665-d0a8-4343-8384-cc60a1636b82/poster.png' | |
}); | |
server.create('clip', 'withLikes', { | |
series: d3, | |
title: 'Intro', | |
slug: 'intro-101' | |
}); | |
server.create('series', 'withClips', { | |
title: 'Refactorings', | |
slug: 'refactorings' | |
}); | |
let pauseTest = server.create('clip', 'withPost', { | |
title: 'Pause test', | |
slug: 'pause-test', | |
description: 'An intro to one of the most useful test helpers.', | |
posterUrl: '/assets/images/posters/pause-test.png', | |
authorName: 'Ryan Toronto' | |
}); | |
server.create('reaction-count', { | |
reactableType: 'Clip', | |
reactable: pauseTest, | |
reaction: 'thumbsup', | |
total: 3 | |
}); | |
server.create('reaction-count', { | |
reactableType: 'Clip', | |
reactable: pauseTest, | |
reaction: 'heart', | |
total: 5 | |
}); | |
server.create('clip', 'withPost', { | |
title: 'Refactor this thing', | |
slug: 'refactor-this-thing', | |
summary: '' | |
}); | |
server.createList('note', 3); | |
server.create('blog-post', { | |
authorName: 'Ryan Toronto', | |
url: 'https://blog.embermap.com/passing-data-around-your-ember-application-c4fe1e06e90', | |
image: 'https://cdn-images-1.medium.com/max/2000/1*h95wbcIxWR8DXqjR8VxowA.png', | |
title: 'Data flow in Ember applications', | |
content: 'Data flow might just be the hardest part of writing a stateful client application. Proper data flow can make or break your Ember app, and the key to success is understanding all your options and knowing when each is most appropriate.' | |
}); | |
// Work with a logged-in user | |
let user = server.create('user', { email: 'sam.selikoff@gmail.com' }); | |
let session = server.schema.sessions.find('current') | |
session.user = user; | |
session.save(); | |
server.create('clip-reaction', { | |
user, | |
clip: firstATclip, | |
reaction: 'heart' | |
}); | |
server.create('clip-reaction', { | |
user, | |
clip: pauseTest, | |
reaction: 'heart' | |
}); | |
server.create('clip-reaction', { | |
user, | |
clip: pauseTest, | |
reaction: 'thumbsup' | |
}); | |
server.create('reaction-count', { | |
reactableType: 'Clip', | |
reactable: pauseTest, | |
reaction: 'thumbsup', | |
total: 9 | |
}); | |
// Work with a subbed user | |
// let team = server.create('team', 'subscribed'); | |
// server.create('team-user', { | |
// team, | |
// user, | |
// email: user.email | |
// }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment