Skip to content

Commit

Permalink
dev and prod DB have different seed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Miguel Gallas Olmedo authored and Jose Miguel Gallas Olmedo committed Jul 21, 2017
1 parent 6fe0493 commit 3670020
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/repository/realm-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ export default class RealmHelper {
}

public static init(mode: string): void {
let users: User[];

if (mode === "development") {
this._config.path = "database/test/users";
users = require("../../spec/support/test-users").default;
} else {
users = require("../assets/seed.json").users;
}

const realm = this.defaultRealm;
Expand All @@ -45,8 +50,6 @@ export default class RealmHelper {
return;
}

const users: User[] = require("../assets/seed.json").users;

realm.write(() => {
for (const user of users) {
realm.create(UserSchema.name, user);
Expand Down

0 comments on commit 3670020

Please sign in to comment.