lib/slaver/pools_handler.rb in slaver-0.0.2 vs lib/slaver/pools_handler.rb in slaver-0.2.0
- old
+ new
@@ -25,10 +25,14 @@
end
def create_connection_pool(config_name)
config = ::ActiveRecord::Base.configurations[config_name]
config.symbolize_keys!
- spec = ActiveRecord::Base::ConnectionSpecification.new(config, "#{config[:adapter]}_connection")
+ if ActiveRecord::VERSION::MAJOR < 4
+ spec = ActiveRecord::Base::ConnectionSpecification.new(config, "#{config[:adapter]}_connection")
+ else
+ spec = ActiveRecord::ConnectionAdapters::ConnectionSpecification.new(config, "#{config[:adapter]}_connection")
+ end
ActiveRecord::ConnectionAdapters::ConnectionPool.new(spec)
end
end
end