Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Factory, association } from 'ember-cli-mirage';
import faker from 'faker';
export default Factory.extend({
author: association(),
article: association(),
createdAt() {
return faker.date.recent();
},
updatedAt() {
return faker.date.recent();
},
body() {
return faker.lorem.paragraphs();
},
});
return faker.name.lastName();
},
suffix() {
return faker.name.suffix();
},
locale() {
return 'en_US';
},
active: true,
timezone() {
return 'America/New_York';
},
acceptedTermsOfService: true,
canViewReviews: false,
social: {},
defaultRegion: association(),
dateRegistered() {
return faker.date.past(2, new Date(2018, 0, 0));
},
withFiles: trait({
afterCreate(user, server) {
server.createList('file', 5, { user });
},
}),
withInstitutions: trait({
afterCreate(user, server) {
server.createList('institution', 3, { users: [user] });
},
}),