lib/definition.js
function(store, modelName) {
  this.store = store
  this.modelName = modelName
  this.model = null

  this.middleware = []

  this.instanceMethods = {}
  this.staticMethods = {}

  events.EventEmitter.call(this)
}
function(store, modelName) {
  this.store = store
  this.modelName = modelName
  this.model = null

  this.middleware = []

  this.instanceMethods = {}
  this.staticMethods = {}

  events.EventEmitter.call(this)
}
function ( store , modelName ) { this . store = store this . modelName = modelName this . model = null this . middleware = [ ] this . instanceMethods = { } this . staticMethods = { } events . EventEmitter . call ( this ) }
There are two ways to define a model.

```js
var store = new OpenRecord({
//my store config
})

store.model('MyModel', function(){
//model definition scope
});
```

or via the `models` config option:

```js
var store = new OpenRecord({
//my store config
models: __dirname + '/models/*'
});
```

```js
// ./models/mymodel.js
module.exports = function(){
//model definition scope
};
```


## Model Definition Scope
The definition scope is like the Model class in ActiveRecord.
Here you'll define all your validations, relations, scopes, record helpers, hooks and more.

### Async
You could also define your model asynchronous
```js
store.model('MyModel', function(next){
//model definition scope
next();
});
```

or via the `models` config option:

```js
// ./models/mymodel.js
module.exports = function(next){
//model definition scope
next();
};
```

@public
@class Definition
 
@public
@class Model
There are two ways to define a model .