AR provides API to establish the custom connection by calling class method like this:
```ruby
Doorkeeper::AccessGrant.establish_connection :another_database
Doorkeeper::AccessToken.establish_connection :another_database
Doorkeeper::Application.establish_connection :another_database
```
But we need calling `establish_connection` after `Doorkeeper.enable_orm` because doorkeeper loads their models dynamically. It's not easy without dookeeper's help.

So we can write as following to avoid conditionals in the models:

```ruby
module Doorkeeper
...
  def self.enable_orm
    require "doorkeeper/models/#{@config.orm}/access_grant"
    require "doorkeeper/models/#{@config.orm}/access_token"
    require "doorkeeper/models/#{@config.orm}/application"
    require 'doorkeeper/models/access_grant'
    require 'doorkeeper/models/access_token'
    require 'doorkeeper/models/application'
    if @config.orm == :active_record
      Doorkeeper::AccessGrant.establish_connection Doorkeeper.configuration.active_record_options[:establish_connection]
      Doorkeeper::AccessToken.establish_connection Doorkeeper.configuration.active_record_options[:establish_connection]
      Doorkeeper::Application.establish_connection Doorkeeper.configuration.active_record_options[:establish_connection]
    end
```

Not good idea :-1: