rails/rails — pull request #12177 by wangjohn (2013-09-09 18:36:09+00:00)
Title: Creating application model template

This PR creates the `ApplicationModel` class. This class will serve as an intermediate between a model and `ActiveRecord::Base`. Currently, to create a model, one follows the following procedure:

```ruby
class MyModelName < ActiveRecord::Base
end
```

This inherits directly from `ActiveRecord::Base` and means that all configurations on `ActiveRecord::Base` are global to all of its subclasses (unless the subclass redefines the configuration on its own).

I'm introducing `ApplicationModel` so that models have an intermediary layer for inheritance like so:

```ruby
class MyModelName < ApplicationModel
end
```

What the `ApplicationModel` class does is allow different sets of configurations to be defined on multiple applications. Each Rails application will have its own `ApplicationModel`. The `ApplicationModel` figures out which application it belongs when it is pulled in through the railtie and `configs_from` is specified.

\cc @spastorino, @josevalim Can you guys take a look? I'm sure there's something I forgot so please let me know.