activerecord-sqlserver-adapter 2.3.23 → 2.3.24

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ * 2.3.24 *
3
+
4
+ * Create a #configure_application_name method that can be overridden for unique TinyTDS app names
5
+ to show up in SQL Server's activity monitor.
6
+
7
+
2
8
  * 2.3.23 *
3
9
 
4
10
  * Create a #configure_connection method that can be overridden. Think "SET TEXTSIZE...".
@@ -147,7 +147,7 @@ module ActiveRecord
147
147
  class SQLServerAdapter < AbstractAdapter
148
148
 
149
149
  ADAPTER_NAME = 'SQLServer'.freeze
150
- VERSION = '2.3.23'.freeze
150
+ VERSION = '2.3.24'.freeze
151
151
  DATABASE_VERSION_REGEXP = /Microsoft SQL Server\s+(\d{4})/
152
152
  SUPPORTED_VERSIONS = [2000,2005,2008].freeze
153
153
  LIMITABLE_TYPES = ['string','integer','float','char','nchar','varchar','nvarchar'].to_set.freeze
@@ -815,7 +815,7 @@ module ActiveRecord
815
815
  config = @connection_options
816
816
  @connection = case @connection_options[:mode]
817
817
  when :dblib
818
- appname = config[:appname] || Rails.application.class.name.split('::').first rescue nil
818
+ appname = config[:appname] || configure_application_name || Rails.application.class.name.split('::').first rescue nil
819
819
  login_timeout = config[:login_timeout].present? ? config[:login_timeout].to_i : nil
820
820
  timeout = config[:timeout].present? ? config[:timeout].to_i/1000 : nil
821
821
  encoding = config[:encoding].present? ? config[:encoding] : nil
@@ -880,6 +880,12 @@ module ActiveRecord
880
880
  def configure_connection
881
881
  end
882
882
 
883
+ # Override this method so every connection can have a unique name. Max 30 characters. Used by TinyTDS only.
884
+ # For example:
885
+ # "myapp_#{$$}_#{Thread.current.object_id}".to(29)
886
+ def configure_application_name
887
+ end
888
+
883
889
  def lost_connection_exceptions
884
890
  exceptions = LOST_CONNECTION_EXCEPTIONS[@connection_options[:mode]]
885
891
  @lost_connection_exceptions ||= exceptions ? exceptions.map(&:constantize) : []
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-sqlserver-adapter
3
3
  version: !ruby/object:Gem::Version
4
- hash: 45
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 23
10
- version: 2.3.23
9
+ - 24
10
+ version: 2.3.24
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Collins