Skip to content

Instantly share code, notes, and snippets.

@vjefri
Created May 22, 2016 04:03
Show Gist options
  • Save vjefri/e6fac1a4b01fb104edbdf79feca9138c to your computer and use it in GitHub Desktop.
Save vjefri/e6fac1a4b01fb104edbdf79feca9138c to your computer and use it in GitHub Desktop.
// models/tweet.js
'use strict';
const Nodal = require('nodal');
const User = Nodal.require('app/models/user.js'); // import me
class Tweet extends Nodal.Model {}
Tweet.setDatabase(Nodal.require('db/main.js'));
Tweet.setSchema(Nodal.my.Schema.models.Tweet);
Tweet.joinsTo(User, {multiple: true}) // add me
return Tweet;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment