Skip to content

Instantly share code, notes, and snippets.

@simong
Created March 18, 2015 16:18
Show Gist options
  • Select an option

  • Save simong/8f05c19d4603e7f02690 to your computer and use it in GitHub Desktop.

Select an option

Save simong/8f05c19d4603e7f02690 to your computer and use it in GitHub Desktop.
// 3 model definitions
Furniture = define(...)
Wood = define(...)
Country = define(...)
// A 3-way join table between furniture and wood and country
FurnitureWood = define();
Furniture.hasMany(FurnitureeWood);
Wood.hasMany(FurnitureWood);
FurnitureWood.belongsTo(Furniture);
FurnitureWood.belongsTo(Wood);
FurnitureWood.belongsTo(Country)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment