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

ah-sequelize-plugin

Package Overview
Dependencies
Maintainers
4
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ah-sequelize-plugin - npm Package Compare versions

Comparing version 0.7.5 to 0.8.0

7

initializers/sequelize.js

@@ -29,2 +29,6 @@ var path = require('path');

});
function currySchemaFunc(SchemaExportFunc) {
return function(a,b) { return SchemaExportFunc(a,b,api) }
};

@@ -64,3 +68,4 @@ api.sequelize = {

var name = nameParts[(nameParts.length - 1)].split(".")[0];
api.models[name] = api.sequelize.sequelize.import(dir + '/' + file);
var modelFunc = currySchemaFunc(require(dir + '/' + file));
api.models[name] = api.sequelize.sequelize.import(name, modelFunc);
});

@@ -67,0 +72,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"description": "I use sequelize in actionhero as an ORM",
"version": "0.7.5",
"version": "0.8.0",
"homepage": "http://actionherojs.com",

@@ -8,0 +8,0 @@ "repository": {

@@ -23,3 +23,3 @@ # ah-sequelize-plugin

```javascript
module.exports = function(sequelize, DataTypes) {
module.exports = function(sequelize, DataTypes, api) {
return sequelize.define("Project", {

@@ -32,3 +32,3 @@ name: DataTypes.STRING,

Models are loaded into `api.models`, so the example above would be `api.models.Project`.
Models are loaded into `api.models`, so the example above would be `api.models.Project`. These module.exports allow for a third optional parameter "api" which is the ActionHero API object. This can be used to access configs and initializer functions, among other things.

@@ -35,0 +35,0 @@ ## [Migrations](http://docs.sequelizejs.com/en/latest/api/migrations)

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