Rework ActiveRecord model table prefix implementation to avoid proxy collection issues on Rails 4

With the following definitions

    class Rack::OAuth2::Server
      class ActiveRecord
        def table_name
          "oauth2_provider_#{name.split("::").last.underscore}"
        end
      end

      class AccessToken < ActiveRecord; end
    end

    class User < ActiveRecord::Base
      has_many :access_tokens, class_name: "Rack::OAuth2::Server::AccessToken"
    end

The ActiveRecord proxy system incorrectly creates the association's table name:

    > User.first.access_tokens
    Mysql2::Error: Table 'myasics_dev.oauth2_provider_active_record' doesn't exist: SHOW FULL FIELDS FROM `oauth2_provider_active_record`