Skip to content

Instantly share code, notes, and snippets.

View beeekind's full-sized avatar

Benjamin Jones beeekind

View GitHub Profile
@beeekind
beeekind / createInstanceWithFieldsAndConnection.js
Created September 23, 2015 23:36
Sexy isomorphic nodeJS function for instantiating any model with explicit fields (to prevent mass injection attacks) and a custom association with our User model. version 3
"use strict";
/** @module createInstanceWithFieldsAndConnection */
var capitalizeFirstLetter = require("../utils/capitalizeFirstLetter");
var models = require("../wrapper").getSingleton();
var async = require("async");
/**
* Isomorphic action for persisting an object or series of objects of model {{name}}, only accepting explicit fields, and