Sha256: 9d3e138da8d4f8a2ff40ad904dea6614038750d9e0705b7fb44d1b7a0a5c798f

Contents?: true

Size: 813 Bytes

Versions: 14

Compression:

Stored size: 813 Bytes

Contents

require 'active_support/lazy_load_hooks'

module Doorkeeper
  module OpenidConnect
    module Orm
      module ActiveRecord
        def initialize_models!
          super
          ActiveSupport.on_load(:active_record) do
            require 'doorkeeper/openid_connect/orm/active_record/access_grant'
            require 'doorkeeper/openid_connect/orm/active_record/request'

            if Doorkeeper.configuration.active_record_options[:establish_connection]
              [Doorkeeper::OpenidConnect::Request].each do |c|
                c.send :establish_connection, Doorkeeper.configuration.active_record_options[:establish_connection]
              end
            end
          end
        end
      end
    end
  end

  Orm::ActiveRecord.singleton_class.send :prepend, OpenidConnect::Orm::ActiveRecord
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
doorkeeper-openid_connect-1.7.1 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.7.0 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.6.3 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.6.2 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.6.1 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.6.0 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.5 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.4 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.3 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.2 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.1 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.5.0 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.4.0 lib/doorkeeper/openid_connect/orm/active_record.rb
doorkeeper-openid_connect-1.3.0 lib/doorkeeper/openid_connect/orm/active_record.rb