Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

The boilerplate code example for custom adapter methods is incorrect #9

Open
wmccracken opened this issue Jul 21, 2014 · 4 comments
Open

Comments

@wmccracken
Copy link

The code sample for custom adapter methods currently reads:
/*

// Custom methods defined here will be available on all models
// which are hooked up to this adapter:
//
// e.g.:
//

foo: function (collectionName, options, cb) {
  return cb(null,"ok");
},
bar: function (collectionName, options, cb) {
  if (!options.jello) return cb("Failure!");
  else return cb();
  destroy: function (connection, collection, options, values, cb) {
   return cb();
 }

During testing, it appears that the connection, collection, options and cb are passed. It should probably read along the lines of:

foo: function (connectionName, collectionName, options, cb) { ... }

@jfrumar
Copy link

jfrumar commented Aug 1, 2014

Thank you - this was confusing me too. Specifically in the find() and create() function prototypes.

It looks like this boilerplate is out of date.

@megastef
Copy link

Is there any updated version?

@AlexCline
Copy link

This example repo shows an example for a sails.js 0.9.x adapter. Newer versions of sails don't support this type of adapter.

@dmarcelino
Copy link
Member

I'm not a 100% sure what are the goals for the boilerplate but I believe current efforts have been made towards the sails-generate-adapter. Having said that, if you submit a PR to the boilerplate I'll gladly take a look.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

5 participants