Last active
August 29, 2015 13:57
-
-
Save jonstorer/9881124 to your computer and use it in GitHub Desktop.
Notes on what my perfect Data generation tool would look like
This file contains hidden or 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
Factory = require('factory') | |
Factory.sequence 'email', (n) -> | |
"user#{n}@example.com" | |
Factory.define('AccessToken', AccessToken) | |
.belongsTo('user') | |
.belongsTo('client') | |
Factory.define('User', User) | |
.sequence('email') | |
.hasMany('accessTokens') | |
.hasMany('agreements') | |
.hasMany('templates', count: 3) | |
.hasMany('organizations', count: 2) | |
.field('first_name', 'Clarence') | |
.field('last_name', 'Darrow') | |
.field('password', 'super-sekret') | |
.field('birthday', -> new Date('4/18/1957')) | |
Factory.define('AccessToken', AccessToken) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment