File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -251,18 +251,20 @@ def bulk_import(*args, &block)
251251 alias import bulk_import unless respond_to? :import
252252end
253253
254- module ActiveRecord ::Import ::Connection
255- def establish_connection ( args = nil )
256- conn = super ( args )
257- ActiveRecord ::Import . load_from_connection_pool connection_pool
258- conn
254+ module ActiveRecord ::Import ::ConnectionHandler
255+ def establish_connection ( * args , ** kwargs , & block )
256+ pool = super ( * args , ** kwargs , & block )
257+ ActiveRecord ::Import . load_from_connection_pool pool
258+ pool
259259 end
260260end
261261
262+ class ActiveRecord ::ConnectionAdapters ::ConnectionHandler
263+ prepend ActiveRecord ::Import ::ConnectionHandler
264+ end
265+
262266class ActiveRecord ::Base
263267 class << self
264- prepend ActiveRecord ::Import ::Connection
265-
266268 # Returns true if the current database connection adapter
267269 # supports import functionality, otherwise returns false.
268270 def supports_import? ( conn = nil )
You can’t perform that action at this time.
0 commit comments