module ActiveRecord
based on active_record/connection_adapters/postgresql/array_parser.rb until it's some day shareable with Rails … this is not public API !
copied from active_record/connection_adapters/postgresql/oid.rb until it's some day shareable with Rails … this is not public API !
Public Instance Methods
require(path)
click to toggle source
@private
Calls superclass method
# File lib/arjdbc/jdbc/adapter_require.rb, line 12 def require(path) # NOTE: we're inspecting resolver.spec connection resolution which does : # `require "active_record/connection_adapters/#{spec[:adapter]}_adapter"` # ... # this {#require} method is only re-defined on a Resolver object and thus # will not hurt performance - it will only be called for a few times (most # likely once), this should still be fine for AR < 3.2 where this patch # ends up on `class << ActiveRecord::Base` since models usually rely on # Rails's auto-loading of (missing) constants and rarely use `require`. # # other alternative (to make sure we do not need to eager load AR built-in # adapters) would be to mingle with the $LOAD_PATH which seems worse ... case path when 'active_record/connection_adapters/mysql_adapter' $LOADED_FEATURES << 'active_record/connection_adapters/mysql_adapter.rb' super('arjdbc/mysql') when 'active_record/connection_adapters/mysql2_adapter' $LOADED_FEATURES << 'active_record/connection_adapters/mysql2_adapter.rb' super('arjdbc/mysql') when 'active_record/connection_adapters/postgresql_adapter' $LOADED_FEATURES << 'active_record/connection_adapters/postgresql_adapter.rb' super('arjdbc/postgresql') when 'active_record/connection_adapters/sqlite_adapter' $LOADED_FEATURES << 'active_record/connection_adapters/sqlite_adapter.rb' super('arjdbc/sqlite3') when 'active_record/connection_adapters/sqlite3_adapter' $LOADED_FEATURES << 'active_record/connection_adapters/sqlite3_adapter.rb' super('arjdbc/sqlite3') else super end end