Sha256: 09c1a5119007aba4e68b3b21ca33dd677b6b8128a1b5f890a51eccac7467b747
Contents?: true
Size: 1.9 KB
Versions: 2
Compression:
Stored size: 1.9 KB
Contents
# frozen_string_literal: true require 'active_support/lazy_load_hooks' module Doorkeeper module OpenidConnect autoload :AccessGrant, "doorkeeper/openid_connect/orm/active_record/access_grant" autoload :Request, "doorkeeper/openid_connect/orm/active_record/request" module Orm module ActiveRecord def run_hooks super if Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0') Doorkeeper.config.access_grant_model.prepend Doorkeeper::OpenidConnect::AccessGrant else Doorkeeper::AccessGrant.prepend Doorkeeper::OpenidConnect::AccessGrant end 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 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 Gem.loaded_specs['doorkeeper'].version >= Gem::Version.create('5.5.0') Doorkeeper.config.access_grant_model.prepend Doorkeeper::OpenidConnect::AccessGrant else Doorkeeper::AccessGrant.prepend Doorkeeper::OpenidConnect::AccessGrant end 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
doorkeeper-openid_connect-1.8.3 | lib/doorkeeper/openid_connect/orm/active_record.rb |
doorkeeper-openid_connect-1.8.2 | lib/doorkeeper/openid_connect/orm/active_record.rb |