Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsonapi-store-relationaldb

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonapi-store-relationaldb - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

CHANGELOG.md

@@ -6,1 +6,3 @@ 2015-06-29 - Initial release

2015-12-10 - v1.0.0
2015-12-11 - Foreign relations
2015-12-11 - v1.0.1

15

lib/sqlHandler.js

@@ -42,3 +42,4 @@ "use strict";

dialect: self.config.dialect,
logging: self.config.logging || debug
logging: self.config.logging || debug,
freezeTableName: true
});

@@ -74,3 +75,3 @@

if (!settings) return false;
return (settings.__one || settings.__many);
return (settings.__one || settings.__many) && !settings.__as;
});

@@ -157,5 +158,5 @@ relations = _.pick(self.resourceConfig.attributes, relations);

if (many) {
self.baseModel.hasMany(relatedModel, { onDelete: "CASCADE" });
self.baseModel.hasMany(relatedModel, { onDelete: "CASCADE", foreignKey: self.resourceConfig.resource + "Id" });
} else {
self.baseModel.hasOne(relatedModel, { onDelete: "CASCADE" });
self.baseModel.hasOne(relatedModel, { onDelete: "CASCADE", foreignKey: self.resourceConfig.resource + "Id" });
}

@@ -168,5 +169,3 @@

var self = this;
var bleh = self.resourceConfig.resource;
if (bleh[bleh.length - 1] === "s") bleh = bleh.substring(0, bleh.length - 1);
bleh += "Id";
var resourceId = self.resourceConfig.resource + "Id";

@@ -186,3 +185,3 @@ Object.keys(json).forEach(function(attribute) {

if (j.uid) delete j.uid;
if (j[bleh]) delete j[bleh];
if (j[resourceId]) delete j[resourceId];
});

@@ -189,0 +188,0 @@ });

{
"name": "jsonapi-store-relationaldb",
"version": "1.0.0",
"version": "1.0.1",
"description": "Relational data store for jsonapi-server.",

@@ -41,3 +41,3 @@ "keywords": [

"mocha-performance": "0.1.0",
"jsonapi-server": "1.0.1"
"jsonapi-server": "1.0.2"
},

@@ -44,0 +44,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc