title: Use reducer method on redux-orm schema instance
body: <p>I am using redux-orm to create models for normalization and denormalization. I find that when I create a schema, I get the error:</p>
  
  <pre><code>Uncaught Error: Schema has been renamed to ORM. Please import ORM instead of Schema from Redux-ORM
  </code></pre>
  
  <p>I have used both the <code>0.90-rc1</code> which is the version installed by default as well as `0.8.4</p>
  
  <p>when running this code:</p>
  
  <pre><code>import { Schema } from 'redux-orm'
  import Todo from './Todo'
  import Tag from './Tag'
  import User from './User'
  
  const schema = new Schema()
  schema.register(Todo, Tag, User)
  
  export default schema
  </code></pre>
  
  <p>However I find that the documentation and code for schemas within redux-orm is still in existance.</p>
  
  <p>If I switch from </p>
  
  <pre><code>import { Schema } from 'redux-orm'
  </code></pre>
  
  <p>to </p>
  
  <pre><code>import { ORM as Schema } from 'redux-orm'
  </code></pre>
  
  <p>the code works but I get an error specifying that <code>reducer</code> method is not defined here:</p>
  
  <pre><code>import { schema } from './models' 
  
  console.log(schema)
  
  const rootReducer = combineReducers({
    orm: schema.reducer(),
    selectedUserId: selectedUserIdReducer
  })
  </code></pre>
  
  <p>Most of the code is based of the <a href="https://github.com/tommikaikkonen/redux-orm-primer" rel="nofollow noreferrer">primer here</a></p>
  
  <p>My Models look like this:</p>
  
  <p><strong>ValidatingModel.js</strong></p>
  
  <pre><code>import { PropTypes } from 'react'
  import { Model } from 'redux-orm'
  import propTypesMixin from 'redux-orm-proptypes'
  
  const ValidatingModel = propTypesMixin(Model)
  
  export default ValidatingModel
  </code></pre>
  
  <p><strong>Todo.js</strong></p>
  
  <pre><code>import { fk, many } from 'redux-orm'
  import { PropTypes } from 'react'
  import ValidatingModel from './ValidatingModel'
  import User from './User'
  import Tag from './Tag'
  import { CREATE_TODO, MARK_DONE, DELETE_TODO, ADD_TAG_TO_TODO, REMOVE_TAG_FROM_TODO } from '../actionTypes'
  export default class Todo extends ValidatingModel {
    static reducer (state, action, Todo, session) {
      const { payload, type } = action
      switch (type) {
        case CREATE_TODO:
          const tagIds = payload.tags.split(',').map(str =&gt; str.trim())
          const props = Object.assign({}, payload, { tags: tagIds })
          Todo.create(props)
          break
        case MARK_DONE:
          Todo.withId(payload).set({ done: true })
          break
        case DELETE_TODO:
          Todo.withId(payload).delete()
          break
        case ADD_TAG_TO_TODO:
          Todo.withId(payload.todo).tags.add(payload.tag)
          break
        case REMOVE_TAG_FROM_TODO:
          Todo.withId(payload.todo).tags.remove(payload.tag)
          break
      }
    }
  }
  
  Todo.modelName = 'Todo'
  
  Todo.propTypes = {
    id: PropTypes.number,
    text: PropTypes.string.isRequired,
    done: PropTypes.bool.isRequired,
    user: PropTypes.oneOf([PropTypes.instanceOf(User), PropTypes.number]),
    tags: PropTypes.arrayOf(PropTypes.oneOf([
      PropTypes.number,
      PropTypes.instanceOf(Tag)
    ]))
  }
  
  Todo.defaultProps = {
    done: false
  }
  
  Todo.fields = {
    user: fk('User', 'todos'),
    tags: many('Tag', 'todos')
  }
  </code></pre>
  
  <p><strong>Tag.js</strong></p>
  
  <pre><code>import ValidatingModel from './ValidatingModel'
  import { PropTypes } from 'react'
  import { CREATE_TODO, ADD_TAG_TO_TODO } from '../actionTypes'
  
  export default class Tag extends ValidatingModel {
    static reducer (state, action, Tag, session) {
      const { payload, type } = action
      switch (type) {
        case CREATE_TODO:
          const tags = payload.tags.split(',')
          const trimmed = tags.map(name =&gt; name.trim())
          trimmed.forEach(name =&gt; Tag.create(name))
          break
        case ADD_TAG_TO_TODO:
          if (!Tag.filter({ name: payload.tag }).exists()) {
            Tag.create({ name: payload.tag })
          }
          break
      }
    }
  }
  
  Tag.modelName = 'Tag'
  
  Tag.backend = {
    idAttribute: 'name'
  }
  
  Tag.propTypes = {
    name: PropTypes.string
  }
  </code></pre>
  
  <p>This is the <strong>User</strong> model, I have added a no-op reducer after seeing @squiroid original answer</p>
  
  <pre><code>import ValidatingModel from './ValidatingModel'
  import { PropTypes } from 'react'
  
  export default class User extends ValidatingModel {
    static reducer (state, action, User, session) {
      return state
    }
  }
  
  User.modelName = 'User'
  
  User.propTypes = {
    id: PropTypes.number,
    name: PropTypes.string
  }
  </code></pre>