Permalink
Browse files

Make login timeout and query timeout backward database.yml friendly f…

…or :dblib mode.
  • Loading branch information...
1 parent 468ef64 commit a5975322683fa8e719e96e1177b4b8bf8ff064dd @metaskills metaskills committed Oct 31, 2010
Showing with 9 additions and 2 deletions.
  1. +5 −0 CHANGELOG
  2. +4 −2 lib/active_record/connection_adapters/sqlserver_adapter.rb
View
5 CHANGELOG
@@ -1,4 +1,9 @@
+* master *
+
+* Make login timeout and query timeout backward database.yml friendly for :dblib mode.
+
+
* 3.0.4 *
* Add multiple results set support with #execute_procedure for :dblib mode. [Ken Collins]
View
6 lib/active_record/connection_adapters/sqlserver_adapter.rb
@@ -346,15 +346,17 @@ def connect
@connection = case @connection_options[:mode]
when :dblib
appname = config[:appname] || Rails.application.class.name.split('::').first rescue nil
+ login_timeout = config[:login_timeout].present? ? config[:login_timeout].to_i : nil
+ timeout = config[:timeout].present? ? config[:timeout].to_i : nil
encoding = config[:encoding].present? ? config[:encoding] : nil
TinyTds::Client.new({
:dataserver => config[:dataserver],
:username => config[:username],
:password => config[:password],
:database => config[:database],
:appname => appname,
- :login_timeout => config[:dblib_login_timeout],
- :timeout => config[:dblib_timeout],
+ :login_timeout => login_timeout,
+ :timeout => timeout,
:encoding => encoding
}).tap do |client|
client.execute("SET ANSI_DEFAULTS ON").do

0 comments on commit a597532

Please sign in to comment.