Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement fake cycle #107

Open
zzarcon opened this issue Jun 4, 2016 · 0 comments
Open

Implement fake cycle #107

zzarcon opened this issue Jun 4, 2016 · 0 comments
Assignees

Comments

@zzarcon
Copy link
Member

zzarcon commented Jun 4, 2016

db.define('tag', faker => {
  return {
    value: faker.cycle('car', 'bike', 'bus')
  };
});

db.create('tag', 3);

This will generate the following records:

[{
  value: 'car'
}, {
  value: 'bike'
}, {
  value: 'bus'
}]

This is useful when you want a element from a specific list and will avoid doing something like

db.create('tag', {value: 'car'});
db.create('tag', {value: 'bike'});
db.create('tag', {value: 'bus'});
@zzarcon zzarcon self-assigned this Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant