Permalink
Browse files

Create the data types

  • Loading branch information...
mtancoigne committed Sep 28, 2018
1 parent a5ce485 commit 986504e6be8d631ab92b59d3de3c29e725be120b
Showing with 54 additions and 0 deletions.
  1. +54 −0 src/data_types/data_types.js
@@ -0,0 +1,54 @@
export default {
user: {
singular: 'user',
plural: 'users',
relations: {
many: ['posts', 'tasks'],
one: [
{field: 'billing_address', type: 'address'},
{field: 'delivery_address', type: 'address'},
],
habtm: [],
},
},
address: {
singular: 'address',
plural: 'addresses',
relations: {
many: [],
one: ['user'],
habtm: [],
},
},
article: {
singular: 'post',
plural: 'posts',
relations: {
many: [],
one: ['user'],
habtm: [
{name: 'tags', field: 'post_id', assoc: 'tag_id'},
],
},
},
tag: {
singular: 'tag',
plural: 'tags',
relations: {
many: [],
one: [],
habtm: [
{name: 'posts', field: 'tag_id', assoc: 'post_id'},
],
},
},
task: {
singular: 'task',
plural: 'tasks',
relations: {
many: [],
one: ['user'],
habtm: [],
},
},
}

0 comments on commit 986504e

Please sign in to comment.