moldy/moldy — pull request #11 by dervalp (2014-05-02 15:00:03+00:00)
Title: Adapter V2

Hi the adapter now looks like:

```
module.exports = {
name: "ajax",
create: function ( data, done ) {
req( this, data, 'post', this.$url(), done );
},
findOne: function ( query, done ) {
req( this, query, 'get', this.$url(), done );
},
find: function ( query, done ) {
req( this, query, 'get', this.$url(), done );
},
save: function ( data, done ) {
var url = this.$url() + ( this.__keyless ? '' : '/' + data[ this.__key ] );

req( this, data, 'put', url, done );
},
destroy: function ( data, done ) {
var url = this.$url() + ( this.__keyless ? '' : '/' + data[ this.__key ] );

req( this, data, 'delete', url, done );
}
};
```

I needed to add the "name" to be able to differentiate adapters.

So now you can use different adapter in Moldy.