Skip to content

Commit

Permalink
Documented chaining of DB.register()
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Sep 13, 2014
1 parent fce4b5c commit 12a537d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ db.MyModel.get(function(err, instance) {
});
```

You can also chain `register` calls to quickly load all your different models using a single line of code.

```javascript
db.register('Model1', require('./models/Model1.js')).register('Model2', require('./models/Model2.js')).connect(function(err, db) {
if(err) throw err;
});
```

## Models
Iridium has been designed to make it as easy as possible to create and manage your models. To support this, models are designed to be stored within their own files - separating them from one another and keeping things logical.

Expand Down

0 comments on commit 12a537d

Please sign in to comment.