Browse files

[fix] Removed wrong example for many-many

  • Loading branch information...
1 parent 4657f2e commit 9bfc7348ac65faa2efe8915971a7c90ece546e00 @pksunkara pksunkara committed Oct 29, 2012
Showing with 0 additions and 51 deletions.
  1. +0 −51 examples/relationship-many-to-many.js
View
51 examples/relationship-many-to-many.js
@@ -1,51 +0,0 @@
-var resourceful = require('../lib/resourceful');
-resourceful.use('memory', { database: "many" });
-
-//
-// Define the resources
-//
-var Artist = resourceful.define('artist'),
- Album = resourceful.define('album'),
- Song = resourceful.define('song');
-
-//
-// Now, define the relationships of every resource
-//
-Album.parent('artist'); // Artists can have many Albums
-Artist.parent('album'); // Albums can have many featured Artists
-Artist.parent('song'); // Songs can have many Artists
-Song.parent('artist'); // Artists can have many Songs
-Song.parent('album'); // Albums can have many Songs
-
-//
-// Now create a few new resources that are related
-//
-// Remark: There are several ways you can now use the resourceful API
-// to interact with your relational resources.
-// The following code is just an example
-//
-
-Artist.create({
- id: 'Beastie Boys'
-}, function(err, result){
- Artist.create({
- id: 'Q-Tip'
- }, function(err, result){
- Album.create({
- id: 'Ill Communication'
- }, function(err, album){
- album.createArtist({ id: "Q-Tip"}, function(err, result){
- console.log(err, result);
- album.createSong({ id: "Get it together"}, function(err, song){
- console.log(err, result);
- album.createArtist({ id: "Beastie Boys"}, function(err, result){
- console.log(err, result);
- Album.get({ id: 'Ill Communication' }, function(err, result){
- console.log(err, result);
- });
- });
- });
- });
- });
- });
-});

0 comments on commit 9bfc734

Please sign in to comment.