Skip to content
This repository was archived by the owner on Feb 13, 2020. It is now read-only.

Commit 986504e

Browse files
committed
Create the data types
1 parent a5ce485 commit 986504e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

src/data_types/data_types.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
export default {
2+
user: {
3+
singular: 'user',
4+
plural: 'users',
5+
relations: {
6+
many: ['posts', 'tasks'],
7+
one: [
8+
{field: 'billing_address', type: 'address'},
9+
{field: 'delivery_address', type: 'address'},
10+
],
11+
habtm: [],
12+
},
13+
},
14+
address: {
15+
singular: 'address',
16+
plural: 'addresses',
17+
relations: {
18+
many: [],
19+
one: ['user'],
20+
habtm: [],
21+
},
22+
},
23+
article: {
24+
singular: 'post',
25+
plural: 'posts',
26+
relations: {
27+
many: [],
28+
one: ['user'],
29+
habtm: [
30+
{name: 'tags', field: 'post_id', assoc: 'tag_id'},
31+
],
32+
},
33+
},
34+
tag: {
35+
singular: 'tag',
36+
plural: 'tags',
37+
relations: {
38+
many: [],
39+
one: [],
40+
habtm: [
41+
{name: 'posts', field: 'tag_id', assoc: 'post_id'},
42+
],
43+
},
44+
},
45+
task: {
46+
singular: 'task',
47+
plural: 'tasks',
48+
relations: {
49+
many: [],
50+
one: ['user'],
51+
habtm: [],
52+
},
53+
},
54+
}

0 commit comments

Comments
 (0)